use strict; use warnings; use 5.010; my $string = q(quux); my @patterns = map { qr/$_/i } qw( foo ba(r|z) quux ); say @patterns; if( $string ~~ @patterns ) { #say q(matched); say qq(This matched: $&); }
In reply to Re^2: string/array smart match regex failing me
by hsinclai
in thread string/array smart match regex failing me
by gizmo_mathboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |