Which regex engine does Notepad++ use?
-
Does anybody know which regex engine Notepad++ uses?
In the searching I’ve done concerning this I’ve seen references to PCRE, Boost, and maybe some others?
I’m asking because I like to use RegexBuddy to build and test regexes before actually using them, and RegexBuddy has a dropdown where you can choose the engine/flavor of regex to use, and I don’t know what to choose for that selection when I’m creating regexes for use with Notepad++ search/replace.
-
-
Your link indicates Boost 1.48, but how do we know this is accurate?
I ask because the release notes for Notepad++ 6.0 indicate PCRE.
I believe I have also seen references to 1.55 being the Boost version in used in N++ regex.
All I’m looking for is something definitive so that I can tell RegexBuddy to use the same thing. It has MANY Boost choices (by version #) that I can pick from.
Thanks!
-
it uses 1.55 for official release see https://github.com/notepad-plus-plus/notepad-plus-plus
To build SciLexer.dll with boost:
Here are the instructions to build SciLexer.dll (for both 32-bit & 64-bit) for Notepad++:
Download the Boost source code. v1.55 should be used with VS 2013. Then unzip it. In my case, boost_1_55_0 is copied in C:\sources\Cheers
Claudia -
FYI Notepad++ supports “PCRE” (i.e. PERL Compatible Regular Expressions) using Boost’s RegEx library which is different from the PCRE and PCRE2 libraries.
Release notes and website could use improvement on pointing this out.
-
It seems like the “PCRE” nomenclature confuses things…more than one would like.
Regardless, armed with my knowledge that it is Boost 1.55, I tried regexes of the form:
find: (a)|(b)
repl: (?1b)(?2a)(this would swap “a” and “b”)
based upon recent discussion of this form of regex replacement from here: https://notepad-plus-plus.org/community/topic/13070/row-swap-for-multiple-files/8
and it didn’t work in RegexBuddy even after specifying the correct Boost flavor in that program. I still have to figure out why it didn’t work, but that seems to be more of a RegexBuddy problem than a Notepad++ thing, as that replacement did work in N++…so I’ll say no more about it here. :-D
-
@Alan-Kilborn select ‘All flavor’ to enable RE for replace in RegexBuddy i.e.
-
Wow. How did you know that it took doing that in RB to get the replacement to work? I read the help file (after seeing your answer) and saw no hints in that direction. I’m impressed. You are truly my RegexBuddy BUDDY! [Also note that I’m not going to try to turn the N++ site into a RB support site (there’s already one of those), so I’ll say no more…]