in reply to Selective Case sensitivity
Yes, you can do that. Here's a simple example:
my @strings = ( 'abBbBBbb', 'AbBbBBbb', ); foreach my $string ( @strings ) { if( $string =~ m/(?-i:a)b+/i ) { print "$string matched.\n"; } else { print "$string didn't match\n"; }
In particular, the (?flags:PATTERN) construct as documented in perlre is what you're after. To turn on case sensitivity for a submatch where it's off in a broader scope you would say (?i:PATTERN), and to turn it off for a submatch (where it's on in a broader scope) you would say (?-i:PATTERN).
Dave
|
|---|