Ben Cartwright wrote:
The groups *are* 0-based. The 0th group is the whole match, e.g.:
Ah, I see! But I also read that if a group number starts with 0, it is
treated as octal. Did I read that wrong, or maybe it doesn't matter
since 0 is 0 in any base system?
--
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
John Salerno wrote:
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.
John Salerno wrote:
John Salerno wrote:
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