Don't ask to ask, just ask | |
PerlMonks |
Re: regular expressionby gav^ (Curate) |
on Jun 08, 2002 at 03:25 UTC ( [id://172733]=note: print w/replies, xml ) | Need Help?? |
If it's a number, treat it like one:
I'm not sure why you'd want to write a regular expression for this, unless it was homework :) If you insist, something like this would do the trick: This uses ^ and $ to anchor the expression to the whole string and the brackets to restrict the alternation. See perlre for more help. gav^
In Section
Seekers of Perl Wisdom
|
|