Don't ask to ask, just ask | |
PerlMonks |
Re: Matching an integer between 0 and 100by ikegami (Patriarch) |
on Sep 01, 2009 at 16:42 UTC ( [id://792700]=note: print w/replies, xml ) | Need Help?? |
Your pattern matches 0 and 100 even though neither are between 0 and 100. Is your question wrong or is your solution wrong? Solutions for "integers between 0 and 100":
Solutions for "integers from 0 to 100":
In all cases, you'll need to anchor the pattern as appropriate. The first solution of each set accepts leading zeroes. Easily changed.
Update: Oops. Accidentally omitted a "?" from my patterns.
In Section
Seekers of Perl Wisdom
|
|