special characters in "search and replace"

  • deadbarnacle

    When using the search and replace function in Crimson Editor, one is given the option to search for (and replace) special characters (notably "end of line" and "beginning of line").

    I think this might be a matter of constructing a regular expression by hand, in Notepad++, that emulates this function (searches for "end of line" and "beginning of line"), but I don't know how to construct it.

    Basically, is there a way to include "end of line" and "beginning of line" as terms to search and replace?

    Just to see if it would work, I selected the usual "end of line, beginning of line" markers in Crimson editor's search field, and then copy/pasted the yielded characters into Notpad++'s search field. It didn't treat it as a regular expression, or a "end of line, beginning of line."

    • Paulius

      You have to turn "Regular expression" on.
      Then in regex, character ^ is beginning of line, $ is end of line. For example, if you want to find "abc", but only if it is first three characters on the line - you must search for "^abc", if the same string but on the end of the line - you must search for "abc$". if you want to find all lines that starts with "aaa" and ends with "bbb" (and it isn't important what is in between them) - you must search for "^aaa.*bbb$".