How to use OR in regular expression?

  • Nobody/Anonymous

    It is not work using OR in regular expression (e.g. (ABC|CDE) ) for searching in the file.
    Is Notepadd++ not support this, or something else?

    • Nobody/Anonymous

      I am not sure, but I think not. You could search in another way.

      Try:  [A-E]

      It's not the best but you should also find the correct words.


      • Thomas Steininger

        This is no solution and a worse style.
        why you don't support the standard with abc|xyz?

        • Nobody/Anonymous

          I agree. Why must every program have its own interpretation of what regular expression is?

          N++ should adopt the closest to widely used standard (POSIX?) to regex.

          • Nobody/Anonymous

            It' scintilla and not notepad. I am agree, too! But all Editors with scintilla uses this regex style. An additional implementation for PCRE or other libs takes time.

            Best Regards

            • GerdB

              GerdB - 2008-11-24

              How about using scintilla with PCRE? It seems that scintilla now supports different egex engines (see "Building with an alternative Regular Expression implementation").

              • korisu

                korisu - 2009-06-12

                +1! I've been thinking this for a long while, and it'd be awesome to see some follow-up for it. I hate having to start up RegexBuddy just because I have to do a search/replace that's too complicated for Scintilla's engine. Could we please get some push for this in the main build?

    • Nobody/Anonymous

      Thanks for your reply.
      But [A-E] only search the single character, I want to search the whole world, i.e. (world1|world2).

    • Nobody/Anonymous

      Yea, you are correct. Therefore try this:





    • GerdB

      GerdB - 2008-11-25

      Followup: I managed to "borrow" the Regex engine from Programmers notepad ( ) which uses boost::xpressive. In particular, I built SciLexer.dll using and thus replaced Scintilla's own RESearch. Hope to see this in the Notepad++ trunk one day.


      • cchris

        cchris - 2009-05-16



      • Don HO

        Don HO - 2009-06-22

        Very attractive.
        However, I see the boost header in "RegexSearch.cpp".
        How do you link with boost library (dynamic or static) ?


    • cchris

      cchris - 2009-06-22

      Isn't Change Markers doing that already?


  • Lorenzo Monti

    Lorenzo Monti - 2010-09-26

    can you kindly provide more details of how you did it?
    thank you - Lorenzo -


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks