in reply to reversing a compiled regex?
One way to do this while still hiding the operation is to expand your data structure. Instead of one level, go to two levels.
The 1 meaning use =~, the 0 meaning use !~.my %rx = ( equals => [ qr/^\Q$sv\E$/i, 1 ], 'not equals' => [ qr/^\Q$sv\E$/i, 0 ],
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: reversing a compiled regex?
by dash2 (Hermit) on Mar 27, 2003 at 12:34 UTC | |
by dragonchild (Archbishop) on Mar 27, 2003 at 15:05 UTC |