In the OP and in your reply above, you use the terms "exact" and "case insensitive" in the context of regex matching in a way that leads me to wonder if you understand that case insensitive matching is inherently inexact. E.g.:
c:\@Work\Perl>perl -wMstrict -le "my $rx = qr/^data_123$/i; print $rx; ;; for my $s (qw(data_123 DATA_123 dAtA_123 data_123x data_12 nada_123) +) { if ($s =~ $rx) { print qq{'exact' match to '$s'}; } else { print qq{NO match to '$s'}; } } " (?^i:^data_123$) 'exact' match to 'data_123' 'exact' match to 'DATA_123' 'exact' match to 'dAtA_123' NO match to 'data_123x' NO match to 'data_12' NO match to 'nada_123'
Update: I should have mentioned that the example above was run under Strawberry Perl version 5.14.4.1.
In reply to Re^3: Compiled regular expression using qr
by AnomalousMonk
in thread Compiled regular expression using qr
by perlbaski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |