in reply to Re^4: Composing regex's dynamically
in thread Composing regex's dynamically
Why are the dollar signs doubled?Typos. Fixed.
Again, that makes me wonder if re-compiling the string is worse than incorporating a compiled regex in another qr.It's certainly not *worse*. Note that if you do:
you compile three patterns, and stringify two. If you write:my $re1 = qr/foo/; my $re2 = qr/bar/; my $re3 = qr/$re1|$re2/;
you compile only one pattern, and stringify none.my $re4 = qq/foo/; my $re5 = qq/bar/; my $re6 = qr/$re4|$re5/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Composing regex's dynamically
by John M. Dlugosz (Monsignor) on Apr 30, 2011 at 08:40 UTC | |
by JavaFan (Canon) on Apr 30, 2011 at 13:12 UTC | |
by Anonymous Monk on Apr 30, 2011 at 13:18 UTC |