Hey guys, I’m trying to select a specific string out of a text, but I’m not a master of regular expressions.
I tried one way, and it starts from the string I want but it matches everything after what I want too.
My regex:
\nSCR((?s).*)(GI|SI)(.*?)\n
Text I’m matching on.
Hierbij een test
SCR
S09
/vince@test.be
05FEB
GI BRGDS OPS
middle text string (may not selected)
SCR
S09
05FEB
LHR
NPVT700 PVT701 30MAR30MAR 1000000 005CRJ FAB1900 07301NCE DD
/ RE.GBFLY/
GI BRGDS
The middle string is selected, it only needs the SCR until the GI line.
To match from a line starting with
SCRto a line starting withGIorSI(inclusive), you would use the following regular expression:This will:
SCRand a new line.GIorSI.GIorSI(this prevents it from matching to the end of the string if there is noGIorSI.