Regular expressions pcre2 · Quantifiers, groups and alternation
Name a capture group
Capture a year by name. JavaScript, PCRE and Java use (?<name>...); Python uses (?P<name>...).
(?<year>\d{4})
Official Regular expressions pcre2 documentation
More quantifiers, groups and alternation commands
- Repeat a pattern
- Match as little as possible
- Match one of several options
- Capture parts of a match
- Group without capturing
- Match repeated text
All quantifiers, groups and alternation commands · Regular expressions pcre2 cheatsheet