I think asking whether a regex is the best way to do this really gets at the heart of the problem. Regexes are great for matching text, but not so hot for parsing it. In this case, I rather think you're in kind of a grey, middle area.
In your place, I might look at Text::ExtractWords. Combine that with Text::Sentence and you could have a very flexible solution that's easier to maintain.
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Regex: Matching around a word(s)
by Ovid
in thread Regex: Matching around a word(s)
by shotgunefx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |