in reply to GREP case insensitivity

There is a good chance that you would want to escape $input so that special regex characters match exactly, rather than taking on their special meaning.

my @bintext2 = grep { /\Q$input\E/i } @bintext;

This way things like "*", "+", and "-" match literally.

Good Day,
    Dean

Replies are listed 'Best First'.
Re^2: GREP case insensitivity
by graff (Chancellor) on Nov 14, 2008 at 00:10 UTC
    Then again, there's an equally good chance that the user wants the special regex characters to be applied as such, and not as literals. In that case, users can supply escapes and "\Q" (or not) according to their preference.