Help for this page

Select Code to Download


  1. or download this
    my $first = "the";
    my $last = "dog";
    my $string = "The black dog danced around the sleeping dog."
    my @matches = $string =~ m/\b($first\b(?!.*?$first.*?)\b$last)\b/g;
    
  2. or download this
    my $first = "the";
    my $last = "dog";
    ...
    # The black dog
    # the sleeping dog
    # the lazy dog