Community
    • Login

    Which regex engine does Notepad++ use?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 11.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alan KilbornA
      Alan Kilborn
      last edited by

      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.

      Claudia FrankC 1 Reply Last reply Reply Quote 1
      • Claudia FrankC
        Claudia Frank @Alan Kilborn
        last edited by

        @Alan-Kilborn

        npp is using boost regex see here for more details.

        Cheers
        Claudia

        Alan KilbornA 1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @Claudia Frank
          last edited by

          @Claudia-Frank

          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!

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Alan Kilborn
            last edited by

            @Alan-Kilborn

            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

            1 Reply Last reply Reply Quote 1
            • MAPJe71M
              MAPJe71
              last edited by

              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.

              Alan KilbornA 1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn @MAPJe71
                last edited by

                @MAPJe71

                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

                1 Reply Last reply Reply Quote 1
                • MAPJe71M
                  MAPJe71
                  last edited by

                  @Alan-Kilborn select ‘All flavor’ to enable RE for replace in RegexBuddy i.e.

                  dummy

                  Alan KilbornA 1 Reply Last reply Reply Quote 2
                  • Alan KilbornA
                    Alan Kilborn @MAPJe71
                    last edited by

                    @MAPJe71

                    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…]

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors