| 349 |
|
|
| 350 |
OP_KET is used for subpatterns that do not repeat indefinitely, while |
OP_KET is used for subpatterns that do not repeat indefinitely, while |
| 351 |
OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or |
OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or |
| 352 |
maximally respectively. All three are followed by LINK_SIZE bytes giving (as a |
maximally respectively (see below for possessive repetitions). All three are |
| 353 |
positive number) the offset back to the matching bracket opcode. |
followed by LINK_SIZE bytes giving (as a positive number) the offset back to |
| 354 |
|
the matching bracket opcode. |
| 355 |
|
|
| 356 |
If a subpattern is quantified such that it is permitted to match zero times, it |
If a subpattern is quantified such that it is permitted to match zero times, it |
| 357 |
is preceded by one of OP_BRAZERO, OP_BRAMINZERO, or OP_SKIPZERO. These are |
is preceded by one of OP_BRAZERO, OP_BRAMINZERO, or OP_SKIPZERO. These are |
| 378 |
that it needs to check for matching an empty string when it hits OP_KETRMIN or |
that it needs to check for matching an empty string when it hits OP_KETRMIN or |
| 379 |
OP_KETRMAX, and if so, to break the loop. |
OP_KETRMAX, and if so, to break the loop. |
| 380 |
|
|
| 381 |
|
Possessive brackets |
| 382 |
|
------------------- |
| 383 |
|
|
| 384 |
|
When a repeated group (capturing or non-capturing) is marked as possessive by |
| 385 |
|
the "+" notation, e.g. (abc)++, different opcodes are used. Their names all |
| 386 |
|
have POS on the end, e.g. OP_BRAPOS instead of OP_BRA and OP_SCPBRPOS instead |
| 387 |
|
of OP_SCBRA. The end of such a group is marked by OP_KETRPOS. If the minimum |
| 388 |
|
repetition is zero, the group is preceded by OP_BRAPOSZERO. |
| 389 |
|
|
| 390 |
|
|
| 391 |
Assertions |
Assertions |
| 392 |
---------- |
---------- |