简体   繁体   中英

Regular Expression not matching in notepad++

I am trying to match this regular expression in notepad++, but I am getting an error saying that it is invalid.

My Regex:

{{#lsth:JointEntero_May_2015\|2015_May_([0-9]+)}}

What I am trying to match:

{{#lsth:JointEntero_May_2015|2015_May_8}}

Why is it failing?

The regex that works is

\{\{\#lsth\:JointEntero_May_2015\|2015_May_([0-9]+)\}\}

It is working because the { and } characters must be escaped in order to get matched as literal symbols. {} are usually used as quantifiers where we can set min and/or max characters corresponding to the preceding pattern to match. See the documentation :


Matches n copies of the element it applies to.

Matches n or more copies of the element it applies to.

Matches m to n copies of the element it applies to, as much it can.

Like the above, but match as few copies as they can. Compare with *? and friends.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM