Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Removing the slashes is pretty easy. Here's one (non-optimal) attempt:
$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. In reply to Re: Re: Re: How can grep search based on text or pattern based on user input?
by chromatic
|
|