When in doubt, make your regexes non-greedy. You'll stay out of a lot of trouble that way.
In reply to Re^3: $1 and regex by dws in thread $1 and regex by Anonymous Monk