Problems? Is your data what you think it is? | |
PerlMonks |
Re: Re: Detect presence of numbers 1-9by Juerd (Abbot) |
on Apr 08, 2002 at 09:37 UTC ( [id://157397]=note: print w/replies, xml ) | Need Help?? |
if ( $scalar =~ /^[12345]+$/ ) { Please note that $ also matches before a trailing \n character, and that this regex also matches "111\n". But I'd go for the negative match anyway, because it seems more natural to me.
In Section
Seekers of Perl Wisdom
|
|