
ericsemail
Novice
Apr 19, 2007, 3:54 PM
Post #1 of 2
(6782 views)
|
Complex matching?
|
Can't Post
|
|
Hi- I'm trying to force a password string to require special characters: must contain at least 1 uppercase letter, 1 lowercase letter, and one non-alphanumeric character. Unfortunately, this must be done using ONLY a one line regular expression--it's for a configuration script that gets read by our Application--so unfortunately, I'm trying to construct a one line regexp that will do this.... I'm not having much luck. my $pw = 'testThisPw!'; or my $pw = '%testThis!PW'; both of these should pass the regexp test, while: my $pw = 'testingThis' would fail because it doesn't have a non-alphanumeric character... In any event, I keep confusing myself when trying to attempt to construct a regexp that satisfies all my needs. Is there a "AND" operator in a perl regexp like the "OR" ( | )? Is this even possible to accomplish in a one line regexp? Thanks for the help in advance.
|