Hints: check carefully for discussions of "capturing," $n variables, and (additional) modifiers (if those other than /g).
In reply to Re: Regex Problem by ww in thread Regex Problem by Anonymous Monk