Auto
GH2003.Jan -097
JL2008.Jul -0.778
HG2009.Jan -0.123
line with “--------------------------------------------------------------------” Some other text
Variation 2:
AB2003.Jan -097
CD2008.Jul -0.778
AR2009.Jan -0.123
line with “---------------------------------------------------------------------”
Some other text
So basically, I want to extract all the lines
AB2003.Jan -097
CD2008.Jul -0.778
AR2009.Jan -0.123
that is NOT preceded by the word “Auto”. After these lines, it can be either a
a) blank line or
b) -------------------------------------------------------------------
I have the solution for your issue for that you have to apply 2 Different Regex
Steps :-
First you will apply this regex .+(?=Auto)
by just enabling 2 Regex Flags i.e Global & Single Line
From which you will get the below ScreenShot as Output
So you will store this output in some variable
Then you will be having the data shown in the below Screenshot that is stored in that variable
So now you will apply this Regex on that 3rd step data \b\w.+(-\d{3}|-0.\d{3})\b
So that now you will get your respected data which you want