wesley chun added the comment:
i wanted to add one additional comment that it would be nice to have a
regex that works with search() (in addition to match()) because such
an email address may appear in the middle of a line, say a From: or
To: email header.
the fix of using a '$' pre
New submission from wesley chun :
In the re docs, it states the following for the conditional regular expression
syntax:
(?(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