Help for this page

Select Code to Download


  1. or download this
    my $str=" some stuff then foo then bar then more stuff";
    print "string=\"$str\"\n";
    ...
    if ($str =~ /(?!^.*foo)(^.*bar.*)/) {print "6 matched \"$1\"\n";}
    if ($str =~ /(?!.*foo)(.*bar.*)/) {print "7 matched \"$1\"\n";}
    if ($str =~ /(?!^.*foo)(.*bar.*)/) {print "8 matched \"$1\"\n";}
    
  2. or download this
    string=" some stuff then foo then bar then more stuff"
    3 matched "oo then bar then more stuff"
    ...
    6 matched " some stuff then bar then more stuff"
    7 matched " some stuff then bar then more stuff"
    8 matched " some stuff then bar then more stuff"