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
Extended
mode, in addition to the search of standard characters and the5
specific characters, below :Character Syntax ---------------- ----------- Tabulation \t
New Line \n
Carriage Return \r
Backslash \\
Null \0
---------------- ----------- Within an Unicode encoding file, a particular character, of code-point
U+00xx
, with xx between00
andff
, 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+00xx
can be found ONLY IF xx belongs to the range[00-7F]
OR to the range[A0-FF]
. When xx lies between80
and9F
, it generally searches for the question mark (?
) as it refers to an Unicode char, whose code-point is not handled by theANSI
encoding ! Only, the5
charactersU+0081
,U+008D
,U+008F
,U+0090
andU+009D
, without any glyph, are correctly searched !
Notes :
-
The
Extended
search mode, as well as theRegular expression
one, cannot be used for searching individual bytes of anUTF-8
orUCS-2
encoded character ! -
The replacement zone, in
Extended
mode, may contain any char, except for the NUL char (\0
) -
When using the
Extended
mode, especially when searching for letters, it is advisable to tick theMatch case
option -
Reminder : In the
Normal
andExtended
search mode, it’s best to NOT tick theMatch whole word only
option, especially when the searched string begins and/or ends with a NON-word character !
So, for instance, with the
Match case
option ticked, theMatch whole word only
option 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\d065
or\o101
or\b1000001
or\x41
-
And if you look for the character, with decimal
ASCII
code 201 (É
), type in, either, the syntax\d201
or\o311
or\b11001001
or\xC9
Best Regards,
guy038
P.S. :
Personally, I think that the only advantage of using the
Extended
mode is when you want to use the\dxxx
syntax, where xxx represents the decimal code of the character :-
Between
000
and255
( so in rangeU+0000 - U+00FF
) within a UTF-8 or UCS-2 encoded file -
Between
000
and127
or between160
and255
( so in rangesU+0000 - U+007F
orU+00A0 - U+00FF
) within an ANSI file
In all other cases, just prefer the
Regular expression
search mode ;-)) -