

Regular expression can be used both in line text in Notepad ++ or Notepad, and for search / replace in various files. The two forms \X and (?s).A notepad feature like regular expressions, known as Regex (regexp), is a mechanism for searching and replacing characters in a text array. In other words, knowing that the option (?s) means single line : However, as the PCRE regex engine of Notepad+, is based, from the 6.0 version, on the Boost C++ Regex library, which it is build, without the Unicode character property support, the form \X, in N++, simply represents ANY single character ( a standard character OR an End of Line character ) :-) So \X is equivalent to the regex (?>\PM\pM*) Typically, characters with the mark property are NON-spacing accents, that affect the preceding character.

Normally the Perl escape sequence \X is a Unicode extended grapheme cluster, which represents a character, without the mark property, followed by zero or more characters with the mark property, all treated as an atomic group. The \X form represents ANY kind of an UNIQUE character ( a Standard OR an End of Line character ) The \R form represents any kind of End of Line ( \r\n for Windows files, \n for Unix files or \r for old MAC files ) The last three regexes are surrounded by round brackets, to be considered as groups 1, 2 and 3įinally, when replacement occurs, these three groups are just written, in a different order !

The regex \X* matches all the remainder characters ( may be NUL ), till the end of your file +\R matches the first NON zero line, ONLY, after the line with dashes ( any number, > 0, of standard characters, followed by the End of Line character(s) ) The regex \X+-\R matches any NON zero amount of ANY character ( Standard OR End of Line ), till the three dashes, with the End of Line character(s)

The regex ^\R matches the first blank line found, with its End of Line character(s) The general idea, about this regex, was to match all the text, from the first blank line found, till the end of the file, splitting it, in the four consecutive zones : If p is greater than 10 you can, either, hit, continuously, the ALT + A shortcut ! You'll stop when you get the message Replace All: 0 occurrence was replaced, at the bottom the Replace dialog
