Hi, D visser,
Oh ! you’re right ! Although it was correctly written in the Notes section, the general regex should be :
(?-s)^.*Your Character|String|Range of Words|Regex expression.*\R ( and NOT (?s)..... ! )
So, I updated my previous post !
Below, here are the FOUR search regex, to enter in the Find what zone, in order to delete :
A) All lines containing the
string MEX, in that
EXACT case
(?-is)^.*MEX.*\R
B) All lines containing the
string MEX,
WHATEVER its case
(?i-s)^.*MEX.*\R
C) All lines containing the
word MEX, in that
EXACT case
(?-is)^.*\bMEX\b.*\R
D) All lines containing the
word MEX,
WHATEVER its case
(?i-s)^.*\bMEX\b.*\R
Notes :
Remember that the Replace with: zone must be EMPTY !
The \b assertions represents, either, the zero-length limit, between :
( A non-word character OR the very beginning of a file ) AND a word character
A word character AND ( a non-word character OR the very end of a file )
The in-line modifier (?-i) forces the search, in a NON-insensitive way
The in-line modifier (?i) forces the search, in a insensitive way
So, suppose the original text, of four lines :
Line 1 : Example ofMEX text
Line 2 : Example ofmeX text
Line 3 : Example of MEX text
Line 4 : Example of MEx text
Then :
The regex A) would delete the lines 1 and 3
The regex B) would delete the lines 1, 2, 3 and 4
The regex C) would delete the line 3
The regex D) would delete the lines 3 and 4
Cheers,
guy038