The perlre page states that (?{ code }) is always successful, but also says that it may be used in a conditional match.
So I'm guessing that if used alone, the code has side-effects only and always succeeds. But if used as the condition of a (?(condition)yes-pattern[|no-pattern]), then it does indeed use the result as the condition.
In reply to Re: Re: conditional match in regex
by John M. Dlugosz
in thread conditional match in regex
by John M. Dlugosz
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |