What's so good about Extended search mode?
-
What’s so good about Extended search mode?
-
I assume, that this has historical reasons. Once upon a time there was this npp release which hasn’t regular expression support but users wanted to be able to delete certain chars and one good soul implemented it. And like in tales, if they didn’t die, the functionality is still alive :-)
-
Hello @prahlad-makwana4145, @ekopalypse and All,
Welcome to the N++ Community !
Actually, in
Extendedmode, in addition to the search of standard characters and the5specific characters, below :Character Syntax ---------------- ----------- Tabulation \tNew Line \nCarriage Return \rBackslash \\Null \0---------------- ----------- Within an Unicode encoding file, a particular character, of code-point
U+00xx, with xx between00andff, can be found with one of the four syntaxes below :Type From To Character Range ------------ ----------- ----------- ----------------- Decimal \d000\d255[0-9]Octal \o000\o377[0-7]Binary \b00000000\b11111111[0-1]Hexadecimal \x00\xFF[0-9A-F]------------ ----------- ----------- ----------------- However, within an ANSI encoded file, an unicode character, of code-point
U+00xxcan be found ONLY IF xx belongs to the range[00-7F]OR to the range[A0-FF]. When xx lies between80and9F, it generally searches for the question mark (?) as it refers to an Unicode char, whose code-point is not handled by theANSIencoding ! Only, the5charactersU+0081,U+008D,U+008F,U+0090andU+009D, without any glyph, are correctly searched !
Notes :
-
The
Extendedsearch mode, as well as theRegular expressionone, cannot be used for searching individual bytes of anUTF-8orUCS-2encoded character ! -
The replacement zone, in
Extendedmode, may contain any char, except for the NUL char (\0) -
When using the
Extendedmode, especially when searching for letters, it is advisable to tick theMatch caseoption -
Reminder : In the
NormalandExtendedsearch mode, it’s best to NOT tick theMatch whole word onlyoption, especially when the searched string begins and/or ends with a NON-word character !
So, for instance, with the
Match caseoption ticked, theMatch whole word onlyoption UN-ticked and theExtended [\n, \r, \t, \0, \x...)search mode selected :-
If you search for the uppercase letter
A, you can choose, either, the syntax\d065or\o101or\b1000001or\x41 -
And if you look for the character, with decimal
ASCIIcode 201 (É), type in, either, the syntax\d201or\o311or\b11001001or\xC9
Best Regards,
guy038
P.S. :
Personally, I think that the only advantage of using the
Extendedmode is when you want to use the\dxxxsyntax, where xxx represents the decimal code of the character :-
Between
000and255( so in rangeU+0000 - U+00FF) within a UTF-8 or UCS-2 encoded file -
Between
000and127or between160and255( so in rangesU+0000 - U+007ForU+00A0 - U+00FF) within an ANSI file
In all other cases, just prefer the
Regular expressionsearch mode ;-)) -