Does notepad++ regular expressions engine (scintilla) support substring escaping (smth. like “\Q.*[escaped string]()+\E”)?

StackOverflow https://stackoverflow.com/questions/4815351

Question

Subj.

I mean that I don't want to paste dozens of '\' into search pattern. Obvious way is to use pair of perl-style special characters:

  • \Q -- quote (disable) pattern metacharacters till \E
  • \E -- end case modification

Example: \Qtext here is excaped ".*[]+" symbols doesn't have special meaning\E.

I found, that \Q...\E doesn't work in notepad++, so I wonder if there is another ability to escape substring?

Was it helpful?

Solution

By now Scintilla uses PCRE which means you can use \Q and \E. Old answer below, because I find it interesting that historically the old “regexes” weren't even regular ;)


No. Scintilla only supports very minimal regular expression syntax. The documentation even highlights more unsupported parts of regular expressions1.

I'd say you should get a decent editor or do the replacing with other tools :-)


1 This even includes alternation (|) and if I'm not mistaken this limits the power of those regular expressions (even though they support backreferences in the match) to an extended subset of regular languages. For example, I do not think that the language {ab, bc} can be represented, although it clearly is regular.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top