in reply to Re: Programmatic regex disjunction
in thread Programmatic regex disjunction

You cannot combine the compiled forms of precompiled regexen, they must be stringified for concatenation and the result has to be recompiled. There’s no way around that.
There is; that is exactly what (??{$someregex}) does.

Replies are listed 'Best First'.
Re^3: Programmatic regex disjunction
by Aristotle (Chancellor) on Nov 22, 2005 at 08:49 UTC

    Ah! Of course.

    But a quick test shows me that that too does not propagate captures from the delayed patterns to the including pattern, which is why I memorised the rule as “combining precompiled patterns requires recompilation.”

    (Most of the time I build a pattern programmatically from a list involves matching one of a list of hash keys, some way or other, so capturing is always involved in some fashion.)

    Thanks for the correction.

    Makeshifts last the longest.