Perl-Sensitive Sunglasses | |
PerlMonks |
Re: subroutine within regex quantifier?by chipmunk (Parson) |
on Dec 04, 2001 at 09:54 UTC ( [id://129270]=note: print w/replies, xml ) | Need Help?? |
Subroutines and method calls don't interpolate inside strings or regexes. However, there's a common trick for interpolating an arbitrary expression inside a double-quoted string, that will work just as well in a regex:
So, you could write your regex in one of these ways: Although they might be hard to read... :)
In Section
Seekers of Perl Wisdom
|
|