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

All quantifiers, groups and alternation commands · Regular expressions pcre2 cheatsheet

Was this page helpful?