- or download this
#!/usr/bin/perl
use strict;
...
print "<br>";
}
}
- or download this
S:\Steve\Dev\PerlMonks\P-2017-05-31@0243-RegEx-Case-Insensitive>perl r
+egex0a.pl
Unrecognized escape \i passed through in regex; marked by <-- HERE in
+m/\i <-- HERE 1\-2\ Steps\i/ at regex0a.pl line 12.
...
<br><br>Couldn't find [catch] anywhere!
<br>
S:\Steve\Dev\PerlMonks\P-2017-05-31@0243-RegEx-Case-Insensitive>
- or download this
my $needle_regex = quotemeta $needle;
if ($haystack =~ /$needle_regex/i) {
- or download this
my @needles = ("1-2 Steps", "5-7 Steps", "8-10 Steps", "catch");
my @haystacks = ("move 1-2 steps", "move 8-10 steps to hoist", "catch
+the ball");
...
print "<br>";
}
}
- or download this
if ($haystack =~ /\Q$needle\E/i) {
- or download this
my @needles = ("1-2 Steps", "5-7 Steps", "8-10 Steps", "catch");
my @haystacks = ("move 1-2 steps", "move 8-10 steps to hoist", "catch
+the ball");
...
print "<br>";
}
}