J
John Salerno
Ok, I've been staring at this and figuring it out for a while. I'm close
to getting it, but I'm confused by the examples:
(?(id/name)yes-pattern|no-pattern)
Will try to match with yes-pattern if the group with given id or name
exists, and with no-pattern if it doesn't. |no-pattern is optional and
can be omitted.
For example, (<)?(\w+@\w+(?:\.\w+)+)(?(1)>) is a poor email matching
pattern, which will match with '<[email protected]>' as well as
'(e-mail address removed)', but not with '<[email protected]'. New in version 2.4.
group(1) is the email address pattern, right? So why does the above RE
match '(e-mail address removed)'. If the email address exists, does the last part
of the RE: (?(1)>) mean that it has to end with a '>'?
to getting it, but I'm confused by the examples:
(?(id/name)yes-pattern|no-pattern)
Will try to match with yes-pattern if the group with given id or name
exists, and with no-pattern if it doesn't. |no-pattern is optional and
can be omitted.
For example, (<)?(\w+@\w+(?:\.\w+)+)(?(1)>) is a poor email matching
pattern, which will match with '<[email protected]>' as well as
'(e-mail address removed)', but not with '<[email protected]'. New in version 2.4.
group(1) is the email address pattern, right? So why does the above RE
match '(e-mail address removed)'. If the email address exists, does the last part
of the RE: (?(1)>) mean that it has to end with a '>'?