http://qs321.pair.com?node_id=342770


in reply to some regex help

I'm not sure how to go about dynamically creating variables like this
The recommended alternative is to use a hash, where ABC is a key, rather than a variable name..

Your regexen are fine. For the last example, you should use \w* instead of .*, as the latter will capture whitespace. If your expression should accept embedded whitespace (or other non-\w chars), it gets a little trickier.


The PerlMonk tr/// Advocate