dash2 has asked for the wisdom of the Perl Monks concerning the following question:
I have a list of regular expressions for use in a simple search filter:
my $sv = _get_search_value(); my %rx = ( equals => qr/^\Q$sv\E$/i, contains => qr/\Q$sv\E/i, 'starts with' => qr/^\Q$sv\E/i, 'ends with' => qr/\Q$sv\E$/i, );
Is there a simple way that I can produce a regex that will match any string not containing $sv?
Help much appreciated.
andramoiennepemousapolutropon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reversing a compiled regex?
by dragonchild (Archbishop) on Mar 26, 2003 at 18:01 UTC | |
by dash2 (Hermit) on Mar 27, 2003 at 12:34 UTC | |
by dragonchild (Archbishop) on Mar 27, 2003 at 15:05 UTC | |
|
Re: reversing a compiled regex?
by diotalevi (Canon) on Mar 26, 2003 at 18:10 UTC | |
|
Re: reversing a compiled regex?
by OM_Zen (Scribe) on Mar 26, 2003 at 19:27 UTC | |
by MarkM (Curate) on Mar 27, 2003 at 02:30 UTC | |
by OM_Zen (Scribe) on Mar 27, 2003 at 15:51 UTC |