July 4th Sale
Limited Time Deal: Unlock all premium questions for over 40% off
$10.42$6.25
10
:
09
:
31
:
32
Back to Dashboard
Annotate First Pattern Match
Easy
Annotate First Pattern Match
You are given a string text containing words separated by spaces, and a list of patterns. For each word in text, find the first substring that matches any pattern (searching patterns in order). Wrap that substring in square brackets []. Only the first match per word is annotated. If no pattern matches a word, leave the word unchanged.
...