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
In reply to Quickie regular expression question. by rementis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |