750 |
immediately on failing to match "foo" the first time. The notation is a kind of |
immediately on failing to match "foo" the first time. The notation is a kind of |
751 |
special parenthesis, starting with (?> as in this example: |
special parenthesis, starting with (?> as in this example: |
752 |
|
|
753 |
(?>\\d+)bar |
(?>\\d+)foo |
754 |
|
|
755 |
This kind of parenthesis "locks up" the part of the pattern it contains once |
This kind of parenthesis "locks up" the part of the pattern it contains once |
756 |
it has matched, and a failure further into the pattern is prevented from |
it has matched, and a failure further into the pattern is prevented from |
1125 |
the Python syntax that PCRE uses for named parentheses (Perl does not provide |
the Python syntax that PCRE uses for named parentheses (Perl does not provide |
1126 |
named parentheses). We could rewrite the above example as follows: |
named parentheses). We could rewrite the above example as follows: |
1127 |
|
|
1128 |
(?<pn> \\( ( (?>[^()]+) | (?P>pn) )* \\) ) |
(?P<pn> \\( ( (?>[^()]+) | (?P>pn) )* \\) ) |
1129 |
|
|
1130 |
This particular example pattern contains nested unlimited repeats, and so the |
This particular example pattern contains nested unlimited repeats, and so the |
1131 |
use of atomic grouping for matching strings of non-parentheses is important |
use of atomic grouping for matching strings of non-parentheses is important |