Help for this page

Select Code to Download


  1. or download this
    my $string = "one two three four";
    $string =~ s/^((?:\w+\s+){2})(\w+)\s+\b/$1/;
    my $word = $2;
    print "$string, $word\n";
    
  2. or download this
    $string =~ s/((?:\w+\s+){2})/$1$word /;