Matching a pattern in many lines of text
You should probably be using find() instead of matches() (source).

I would recommend using regexpal to test out your pattern, just in case.

Whether or not the Regex solution is faster, you'd have to run some tests, but I suspect it's MUCH faster.