in reply to Getting regexp from Regexp references
(?-xism:^foo\.c$)That is a perfectly valid regexp. The (?- allows one to specifiy regexp option inside the regexp pattern itself.
In addition to build your alternation there is no need to extract the original regexp, since you can quite safely interpolate Regexp objects into patterns:
my (@a) = (qr/^foo\.c$/, qr/^bar\.c$/, ); /$a[0]|$a[1]/; #or my $re = join("|", @a); /$re/;
--
integral, resident of freenode's #perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting regexp from Regexp references
by bart (Canon) on Jan 28, 2003 at 20:36 UTC | |
|
Re: Re: Getting regexp from Regexp references
by steves (Curate) on Jan 28, 2003 at 20:32 UTC |