my $re = quotemeta($str2); if( $str1 =~ /^$re/ ) { print "match\n"; } else { print "nomatch\n"; }
index (already shown) is faster.
In reply to Re: Regex Start Anchor with variables
by ikegami
in thread Regex Start Anchor with variables
by chrism01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |