note that @vocabulary has to be sorted in such a way that "longer" words come earlierIf you depend on a module like Regex::PreSuf, not only will it have the same effect, i.e. matching the longest match possible, but likely, it'll match faster, at least for longer lists, and pre 5.10 perl.
In reply to Re^2: Split a sentence into words
by bart
in thread Split a sentence into words
by ThreeMonks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |