Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ explicit quantifier notation

I've been playing around with the Notepad++ regular expression engine, but there's something I can't make work, it's the explicit quantifier notation.

I've seen some other posts here where the following syntax is used : (expr){1,2}

However, when I use it in a test as simple as k{1,1} where the text to search is k : there is no match. I tried a lot of syntax's : {1,}, {1}, etc. Am I missing something here ?

Please excuse my bad english, and thanks for your answers !

like image 799
igelineau Avatar asked Oct 28 '11 01:10

igelineau


2 Answers

Starting with version 6.0, Notepad++ supports PCRE (source). Quantifiers will work as expected in these versions.

The regex engine of Notepad++ 5.9.8 and lower does not support quantifiers (source).

You can, however, use the following quantifiers:

  • k*, which is equivalent to k{0,}.
  • k+, which is equivalent to k{1,}.
  • k?, which is equivalent to k{0,1}.

If you want other quantifiers, you can combine the above methods.

Examples:

  • kkk+ emulates k{3,}
  • kkkk?k? emulates k{3,5}
like image 72
Dennis Avatar answered Oct 30 '22 19:10

Dennis


Notepad++'s regular expression system does not appear to support that feature. They do support k+ and k*.

like image 1
Dan Avatar answered Oct 30 '22 19:10

Dan