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 reply to Re: Regular expressions
by Fletch
in thread Regular expressions
by DDH
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |