in reply to Regex Matching Oddity

Every time the pattern for $2 matches (the second ([-\w]+) in this case), it replaces the $2 with the new value. So, in effect, they were overwritten, just as you speculate.

What you want, I'm not positive a regex can do. split definitely seems like your best option, as you said. Hope this helps!

--jwest

-><- -><- -><- -><- -><-
All things are Perfect
    To every last Flaw
    And bound in accord
         With Eris's Law
 - HBT; The Book of Advice, 1:7