laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
...may contain 1 or more of the characters smtwhfa in any order. That means you want '+' instead of '*' for the quantifier. You can make sure there are no repetitions with a hash over the characters: That uses the uniqueness of hash keys to enforce your requirement. You can do that with regex lookahead by a negated match, $string !~ /([smtwhfa])(?=.*\1)/ after the match for the character class. That returns true if there is no match for a repeated character (untested). After Compline, In reply to Re: Regex (lookahead) Confusion
by Zaxo
|
|