Help for this page

Select Code to Download


  1. or download this
    while ( ($p = index $haystack, $needle, $p+1) > -1 ) {
        # e.g. (not tested)
        pos($haystack) = $p;
    ...
            # regex doing the tough dishes
        ;   # /c flag: preserve pos() on non-match
    }