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++?
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.
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 .
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With