Think about Loose Coupling | |
PerlMonks |
Re: Subscription Stuffby BronzeWing (Monk) |
on Aug 03, 2002 at 21:40 UTC ( [id://187405]=note: print w/replies, xml ) | Need Help?? |
I felt an itch to try to do this in one regex. Admittedly it's a longer string than checking with two short ones, but here's a single regex that I believe does the same thing: m/^[\w-]*[A-Z\-\_][\w-]*$/iBasically, "There must be a single character that is a letter, a dash, or an underscore. It can also have any number of characters before or after it if none of those characters are anything but word characters (letters or underscores) or dashes." -BronzeWing
In Section
Seekers of Perl Wisdom
|
|