- or download this
@regexps = qw( foo bar baz );
@strings = qw( abc def ghi );
...
$string =~ /$regexp/
}
}
- or download this
>perl -Mre=debug -e"@regexps = qw( foo bar baz ); @strings = qw( abc d
+ef ghi ); for $string (@strings) { for $regexp (@regexps) { $string =
+~ /$regexp/ } }" 2>&1 | find "Compiling"
Compiling REx `foo'
...
Compiling REx `foo'
Compiling REx `bar'
Compiling REx `baz'
- or download this
@regexps = qw( foo bar baz );
@strings = qw( abc def ghi );
...
$string =~ /$regexp/
}
}
- or download this
>perl -Mre=debug -e"@regexps = qw( foo bar baz ); @strings = qw( abc d
+ef ghi ); for $regexp (@regexps) { for $string (@strings) { $string =
+~ /$regexp/ } }" 2>&1 | find "Compiling"
Compiling REx `foo'
Compiling REx `bar'
Compiling REx `baz'
- or download this
@regexps = map qr/$_/, qw( foo bar baz ); # All I did was add the qr
+//.
@strings = qw( abc def ghi );
...
$string =~ /$regexp/
}
}
- or download this
>perl -Mre=debug -e"@regexps = map qr/$_/, qw( foo bar baz ); @strings
+ = qw( abc def ghi ); for $string (@strings) { for $regexp (@regexps)
+ { $string =~ /$regexp/ } }" 2>&1 | find "Compiling"
Compiling REx `foo'
Compiling REx `bar'
Compiling REx `baz'