in reply to Capitalization and Regex
So... do not try to do:
Rather... try this:my $munged_name = Regch($name); $thing =~ /$munged_name/;
$thing =~ /\Q$name\E/i;
How much easier is that? Also, you learned an important thing about perl. :-D
-----------------------------------
However, if you want a direct and exact answer to your question, you could do this:
Read the docs on perlre to learn more about why.sub Regch { return "(?i:\Q$_[0]\E)"; }
|
|---|