in reply to Re: Dictionary filter regex
in thread Dictionary filter regex
> Mushing this into a single regular expression is possible, by using [^sh] instead of dot
Do you mean /s[^sh]*h/i ?
I doubt this, you would also need to check all characters before and after the match
/^ [^sh]* s [^sh]* h [^sh]* $/xi *
Otherwise something like "h--<s--h>--s" should match in the middle. (Untested)
I think this demonstrates well why stuffing all logic into one regex is not always a good idea, particularly inversion isn't trivial.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
*) I just saw that tybalt89++ already posted this regex in this thread.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dictionary filter regex
by Corion (Patriarch) on Nov 26, 2016 at 19:25 UTC |