-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathQuantifier.regex.txt
More file actions
12 lines (12 loc) · 767 Bytes
/
Quantifier.regex.txt
File metadata and controls
12 lines (12 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
# Matches a quantifier
(?<!\\) # A Quantifier Can Be
(?> # A <RangeQuantifier>
(?<RangeQuantifier>\{(?>(?<Count>\d(?=})) # With Fixed <Count> OR
|(?<Min>\d+) # A <Min>
\,(?<Max>\d+)? # With an optional <Max> OR
|\,(?<Max>\d+) # A <Max> preceeded by a comma
)\})|(?<Greedy>[\+\*]) # A Quantifier can can also be <Greedy> (+ or *) OR
|(?<Lazy>\?) # A Quantifier can be <Lazy>
)(?>(?<Lazy>\?) # If a quantifier is followed by ?, it is <Lazy>
|(?<Possessive>\+) # If a quantifier is followed by +, it is <Possesive>
)?