in reply to Regular expression to check for qwerty sequence in a password
Hi brad,
You may want to be a bit more specific in your definition of sequences. From what you've said it isn't clear what you mean. for e.g. would the sequence fdsa be acceptable? What about Asdf or asDf?
Either way; if I were to divine what you're trying to accomplish, i.e. to match a string of at least three chars that does NOT contain a multi-char sequence like "asd" or "wer" - I would tweak your if conditional and reg exp to something like this:
if (length($password) > 2 && ($password =~ m/(?:^(?!(asd)|(wer)))/))
Cheers,
Shadowsong
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regular expression to check for qwerty sequence in a password
by bradcathey (Prior) on Oct 09, 2016 at 17:44 UTC | |
by AnomalousMonk (Archbishop) on Oct 12, 2016 at 01:28 UTC |
In Section
Seekers of Perl Wisdom