Regular Expression named groups

From Birnam Designs Wiki

Jump to: navigation, search

\g<name> uses the substring matched by group name, e.g. (?P<name>...)

This can also be used with numbered groups: \g<number>. This prevents some instances of ambiguous matches. e.g.

\g<2>0

is a reference to group 2 followed the the character 0

\20

is a reference to group 20

Share This!
This page was last modified on 19 January 2009, at 20:01. This page has been accessed 221 times.