in reply to Matching non-words
If the first scalar @words - 1 tokens match, there's a good possibility the last piece is unique.$subject =~ tr/a-zA-Z0-9_/ /sc; my @words = split(' ', $subject); my $regex = join(' ', map { "($_)?" } @words); my $num_matches = () = $potential_match =~ $regex; if ($num_matches == (@words - 1)) { register($words[-1]); }
Food for thought.
|
|---|