Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @pairs = $s =~ /(?=(\w+ \s+ \w+))\w+ \s+/gx;
    
    print join "\n", @pairs;
    
  2. or download this
    This is
    is a
    a test
    
  3. or download this
    ...
    my @pairs = map [split], $s =~ /(?=(\w+ \s+ \w+))\w+ \s+/gx;
    
    print "@$_\n" for @pairs;
    
  4. or download this
    This is
    is a
    a test