in reply to Re: Re: How can grep search based on text or pattern based on user input?
in thread How can grep search based on text or pattern based on user input?
$input =~ s!^/(.+)/$!$1!;
With that in place, everything you've described so far, except for the $modifiers, will work. You'd either have to escape everything and wrap the whole grep in an eval block, or use some sort of checkbox or if-else block to check for a case insensitive flag.
Perl won't (as far as I know, and I'm pretty sure about this having just tested it) interpolate a variable in the regex flag position.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How can grep search based on text or pattern based on user input?
by chipmunk (Parson) on Dec 04, 2000 at 23:02 UTC |