sub is_ci { my ($pat) = @_; my ($pos_mods) = $pat =~ /^\(\?(\w*)(?:-\w*)?:.*\)/s or return 0; return $pos_mods =~ /i/; } #### use re qw( regexp_pattern ); sub is_ci { (regexp_pattern(shift))[1] =~ /i/ } #### qr/(?i:hello)/ qr/(?i)hello/ qr/[hH][eE][lL][lL][oO]/ qr/1234/ #### qr/(?-i)hello/i qr/(?-i:hello)/i qr/he(?-i:l)lo/i
## use re qw( regexp_pattern ); sub is_ci { (regexp_pattern(shift))[1] =~ /i/ } ##
## qr/(?i:hello)/ qr/(?i)hello/ qr/[hH][eE][lL][lL][oO]/ qr/1234/ ##
## qr/(?-i)hello/i qr/(?-i:hello)/i qr/he(?-i:l)lo/i