Not quite what the OP wanted. It was required that the word was completely made of allowed characters only. Try this:
while (<DATA>) { chomp; if (! /([smtwhfa])(?=.*?\1)/) { print "$_ : OK\n"; } else { print "$_ : Not OK\n"; } } __DATA__ smsa smta stmwhas BADsmtaEXAMPLE
And the output
smsa : Not OK smta : OK stmwhas : Not OK : OK BADsmtaEXAMPLE : OK
In reply to Re: Re: Regex (lookahead) Confusion
by Anonymous Monk
in thread Regex (lookahead) Confusion
by ChrisR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |