I have the following different texts
line1: SELECT column1,
line2: column2,
line3: RTRIM(LTRIM(blah1)) || ' ' || RTRIM(LTRIM(blah3)),
line4: RTRIM(LTRIM(blah3)) || ' ' || RTRIM(LTRIM(some1)) outColumn,
line5: RTRIM(LTRIM(blah3)) || ' ' || RTRIM(LTRIM(some1)) something,
line6: somelast
Following is what I want to get out of each line basically want to start the regex search from end of string and keep going untill space. I can take out comma later on.
line1: column1
line2: column2
line3: <space> nothing found
line4: outColumn
line5: something
line6: somelast
basically I will be fine if I can start the regex from the end and walk towards first space.
There probably will have to be a special case for line3 as I dont expect anything back.
I am using groovy for this regex.