rementis has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to determine if a variable contains ONLY letters and numbers. If there are any characters besides letters and digits I want the test to fail. I'm using this code and it's not working:
(There is a bracket before the A and after the 9, but it's not showing up in this web page for some reason.)if ($newpasswd !~ /[A-Za-z0-9]/) { EXECUTE SOME THINGS; }
Any ideas are welcome, thanks!
20050316 Edit by ysth: p & code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Quickie regular expression question.
by ikegami (Patriarch) on Mar 16, 2005 at 17:16 UTC | |
|
Re: Quickie regular expression question.
by RazorbladeBidet (Friar) on Mar 16, 2005 at 17:16 UTC | |
|
Re: Quickie regular expression question.
by holli (Abbot) on Mar 16, 2005 at 17:18 UTC | |
by ikegami (Patriarch) on Mar 16, 2005 at 17:28 UTC | |
by Fletch (Bishop) on Mar 16, 2005 at 17:36 UTC | |
|
Re: Quickie regular expression question.
by saintmike (Vicar) on Mar 16, 2005 at 17:19 UTC | |
|
Re: Quickie regular expression question.
by sh1tn (Priest) on Mar 16, 2005 at 17:53 UTC | |
|
Re: Quickie regular expression question.
by rementis (Beadle) on Mar 16, 2005 at 17:48 UTC |