|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^3: Arbitrary number of captures in a regular expressionby Sidhekin (Priest) |
| on Sep 25, 2007 at 11:06 UTC ( #640897=note: print w/ replies, xml ) | Need Help?? |
|
Id do something like this myself. Except id probably not use look ahead and instead would approach it a different way. I was annoyed with the lookahead myself, but it's unlikely to be a big deal, and I could not at the time see any way to avoid it. After some thinking, however, I believe I see a way to avoid looking ahead more than once -- just include it in the first alternation, which is matched precisely once on a successful match (anchored to the beginning of the string, and the only alternation that can match there):
... or, in the less-terse form:
I think that's the best I got. Match that? :)
print "Just another Perl ${\(trickster and hacker)},"
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||