Searching using regular expressions

  • Mike Broschinsky

    Perhaps because I'm a regular expression neophyte, or perhaps because I'm just dim, I can't figure out how to search using regular expressions.

    I need to be able to search for and replace: line feeds, line feeds/carrage returns, page breaks, and other control characters.  When I try to search for a \r, checking the regular expression box in the find dialogue, I get this message: "Can't find the word".  I can, though, search for \t and find a tab successfully.

    I'm sure I'm missing something obvious, but haven't been able to see anything in previous discussions that might help.  What magic am I missing?



    • Mike Broschinsky

      Maybe I should have said "escaped expressions".  For example, I want to search for a carriage return.  If I use SciTE, another editor based on Scintilla, I can go to the find dialogue, click in the "Transform backslash expressions" box, and find a carriage return.  Can I do this somehow in Notepad++?



      • Nobody/Anonymous

        Apparently, the "lookaround", one of my favorite flavor of regexp, isn't responding...

    • Don HO

      Don HO - 2004-08-07

      I don't think "\t" and "\r" are part of regular expression.
      For the "\r", Notepad++ doesn't support "backslash expression". You may use regular expression symbol "$" (the end of line, that is the solution most close I can found).

      For example :
      "[a-zA-Z]$" you can find all the characters (from a to z) at the end of lines.

      hope it helps


    • Mike Broschinsky

      Yes, this does help.  Is there a resource that tells me all of the regular expressions supported by Notepad++, or are *all* regular expressions supported?  A Google search for "regular expressions" yields a number of results, many of them geared to programming languages such as Python and Perl.  Does Notepad++ support the same type of regular expressions?




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

Sign up for the SourceForge newsletter:

No, thanks