User:Eugrus/regex
Appearance
Syntax | BRE | ERE | PCRE |
---|---|---|---|
Anchors | ^ $ | ^ $ | ^ $ \A \Z |
Character Classes | [abc] [a-z] [^abc] | [abc] [a-z] [^abc] | [abc] [a-z] [^abc] \d \D \s \S \w \W |
Quantifiers | * \{m,n\} | * + ? \{n\} \{n,\} \{n,m\} | * + ? \{n\} \{n,\} \{n,m\} lazy matching |
Grouping | \(abc\) | (abc) | (abc) (?:abc) |
Alternation | N/A | def | def (?>abc) |
Capturing Groups | \1 \2 | \1 \2 | \1 \2 (?P<name>) |
Lookahead/Lookbehind | N/A | N/A | (?=abc) (?!abc) (?<=abc) (?<!abc) |
Backreferences | \1 \2 | N/A | \1 \2 |
Comments | N/A | N/A | (?#comment) |