Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++:Searching an regex-expression n times

the text:

aaa

the regex:

a{2}

the answer of notepad++ (v5.9.6.2 (UNICODE)): Can't find the text "a{2}"

How can I realize this expression (searching n times) in notepad++?

like image 561
Jobacca Avatar asked Jan 11 '12 13:01

Jobacca


People also ask

Can I use regex in Notepad?

Using Regex to find and replace text in Notepad++ In all examples, use select Find and Replace (Ctrl + H) to replace all the matches with the desired string or (no string). And also ensure the 'Regular expression' radio button is set.

What does * n in regex mean?

Allows ASCII codes to be used in regular expressions. \x n. Matches n, where n is a hexadecimal escape value. Hexadecimal escape values must be exactly two digits long. For example, \x41 matches A .

What does regex 0 * 1 * 0 * 1 * Mean?

Basically (0+1)* mathes any sequence of ones and zeroes. So, in your example (0+1)*1(0+1)* should match any sequence that has 1. It would not match 000 , but it would match 010 , 1 , 111 etc. (0+1) means 0 OR 1. 1* means any number of ones.


1 Answers

UPDATE: as of Notepad++ 6.x which now uses PCRE as its regex engine, your given expression should now work as is.

Notepad++ older than 6.0 doesn't support number quantifiers in its regex engine. You'll have to make do with aa (repeating the input n times).

like image 134
BoltClock Avatar answered Oct 16 '22 22:10

BoltClock