
kencl
User
Jun 16, 2001, 5:27 PM
Post #1 of 10
(4859 views)
|
|
Which pattern match operators should I use?
|
Can't Post
|
|
Hi Folks, I'm doing a simple pattern match to insure that form input contains only alpha-numeric characters. Wondering which pattern matching operators I should be using? The match is:
if ($$InputPointer{'password'} =~ m/[^a-zA-Z0-9]/operators) { &PrintPage("Invalid Password", "", "Passwords may only contain letters or numbers. Please use you browser's BACK button to enter a different password."); exit; } I'm thinking I should use g because I want it to check every character, o because the match won't change the value I am testing, and s because the string being tested is a single word. Also, does it make a difference which order the operators are specified in? IE is m/pattern/ixm the same as m/pattern/mix? Advanced thanks. >> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!
|