Hi, @banjo-g, @alan-kilborn and All,
A generic and general form of the regex, described in my previous post, could be :
SEARCH (?-is)^.*?Expression A(?s).*?Expression B.*?$\R
Basically, this regex :
Searches for two lines :
A line A, containing Expression A, at any location of line A
A line B, containing Expression B, at any location of line B
Selects all range of characters, generally multi-lines, from the beginning of line A till the end of line B, with its EOL characters
The lines A and B may be identical. However, in that case, Expression B must be located after Expression A, in current line !
Notes :
First, the in-line modifier (?-is)
Carries a non-insensitive search ( so sensitive to case )
Forces the regex engine to interpret the regex dot symbol . as matching a single standard character ( not EOL ones )
Then, the part ^.*?Expression A matches, from beginnning of line, the shortest range, possibly null, of standard characters, followed by Expression A, with that exact case
Now, the part (?s).*?Expression B looks for the shortest range, possibly null, of characters, including EOL, followed by Expression B, with that exact case
Finally, the part .*?$\R searches for the shortest range, possibly null, of characters till an end of line, followed with its line-break
Cheers,
guy038