Welcome to the Monastery | |
PerlMonks |
Re: Regular expressionsby Fletch (Bishop) |
on Apr 13, 2005 at 13:27 UTC ( [id://447367]=note: print w/replies, xml ) | Need Help?? |
You're only checking if there's at least one character matching your character class anywhere in your input. Anchor your regex: $temp2 =~ m/\A[a-zA-Z]+\z/. Read perldoc perleretut and perldoc perlre. And remember to use <code></code> tags next time.
In Section
Seekers of Perl Wisdom
|
|