Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    if (/((A(?:B(?:C(?:\s+(?:X(?:Y(?:Z)?)?)?)?)?)?))/) {
        print "Searched for 'ABC\\s+XYZ' but only found $1";
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
    print "Searched for 'ABC\\s+XYZ' but only found '$longest'\n";
    __END__
    Searched for 'ABC\s+XYZ' but only found 'ABC X'