Next | Regular Expression Mastery | 82 |
These all appeared in 5.005
(?{CODE}) embeds arbitrary code into a regex
The code is executed when the node pointer passes through it
It matches the empty string and always succeeds
(?(CONDITION)YES|NO) evaluates the condition
If true, try to match YES, else NO
omit NO, it defaults to nothing
CONDITION can be a (?{CODE}) expression
Example: Match strings where (...) are balanced
(The holy grail of regular expressions.)
Next | Copyright © 2002 M. J. Dominus |