in reply to Re: Regex (lookahead) Confusion
in thread Regex (lookahead) Confusion
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Regex (lookahead) Confusion
by allolex (Curate) on Feb 05, 2004 at 21:17 UTC | |
by Anonymous Monk on Feb 05, 2004 at 21:54 UTC |