Help for this page

Select Code to Download


  1. or download this
    print 'xxxxaxxxxbxxxx' =~ /a(?>.*?)b/ ? 'match' : 'fail';
    
  2. or download this
    $string = 'abcd';
    $regex = '^' . join '', map "[^$_]*$_", map quotemeta, split //, $stri
    +ng;
    ...
    if($sequence =~ /$regex/s) {
        printf "I found a match, at offset %d and with total length %d\n",
    + $-[1], $+[1]-$-[1];
    }