Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    $string =~ /anotherwordhere\s+(.*) wordhere/;
    print "Greedy match    : '$1'\n";
    
  2. or download this
    Non-greedy match: 'foobar'
    Greedy match    : 'foobar wordhere baz qux'