Help for this page

Select Code to Download


  1. or download this
    my @vocabulary = qw(a abc abcd abd bc);
    my $sentence = 'abdaabc';
    
  2. or download this
    my $pattern = join '|', @vocabulary;
    
    $sentence =~ /^($pattern)+$/;
    ...
    my @list2;
    $sentence =~ /^(($pattern)(?{push @list2, $^N}))+$/;
    print (join ",", @list2), "\n"