Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
        print "<br>";
        }
    }
    
  2. 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>
    
  3. or download this
    my $needle_regex = quotemeta $needle;
    if ($haystack =~ /$needle_regex/i) {
    
  4. 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>";
        }
    }
    
  5. or download this
    if ($haystack =~ /\Q$needle\E/i) {
    
  6. 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>";
        }
    }