lokiloki has asked for the wisdom of the Perl Monks concerning the following question:
The following presumably means match anything that does not contain either "a" or "b":
[^ab]+
How can I write code that means match anything that does not contain, for instance, "ah" or "bh"? Would this work:
[^(ah|bh)]+
Or this:
(^(ah|bh))+
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: RegEx: How to negate more than one character?
by Sidhekin (Priest) on Mar 26, 2007 at 00:15 UTC | |
Re: RegEx: How to negate more than one character? ((?!...).)
by tye (Sage) on Mar 26, 2007 at 00:54 UTC | |
Re: RegEx: How to negate more than one character?
by shigetsu (Hermit) on Mar 25, 2007 at 23:07 UTC | |
by lokiloki (Beadle) on Mar 25, 2007 at 23:15 UTC | |
by jettero (Monsignor) on Mar 25, 2007 at 23:34 UTC | |
Re: RegEx: How to negate more than one character?
by Zaxo (Archbishop) on Mar 26, 2007 at 05:28 UTC | |
Re: RegEx: How to negate more than one character?
by gube (Parson) on Mar 26, 2007 at 00:56 UTC |
Back to
Seekers of Perl Wisdom