Notepad ++ and regex

I am doing some tests with Find in Notepad ++ using regex. Here is my problem that I cannot figure out why:

My text:

abc/xyz/p234/s-sdf

      

The following regex matches well:

[a-z]+/[a-z]+(/p[0-9]+)/s-[a-z]+

      

But why does the following regex (with "?" Appended) no longer match:

[a-z]+/[a-z]+(/p[0-9]+)?/s-[a-z]+

      

Am I correct that in the last regex '?' means that (/ p [0-9] +) can be displayed zero or one time?

+3
regex notepad ++


source to share


No one has answered this question yet

Check out similar questions:

1589
How do I format XML in Notepad ++?
1323
RegEx match public tags, excluding XHTML tags
974
Convert tabs to spaces in Notepad ++
811
How can I reformat JSON in Notepad ++?
568
Removing duplicate lines in Notepad ++
347
Removing blank lines in Notepad ++
257
Greedy vs reluctant vs overbearing quantifiers
nineteen
How to use the Regex feed for Notepad ++ | for strings longer than one character?
2
Regex only matches the first occurrence in a line in notepad ++
0
How to make inline selected text using Replace RegEx in Notepad ++



All Articles
Loading...
X
Show
Funny
Dev
Pics