Trying to capture group in javascript regex (port from c#)
===

I have this regex
    
    var mregex = /(\$m[\w|\.]+)/g;
    string mstring= "$m.x = $m.y";

So basically capture each instance of $m.[+ any number of alphanumeric or \. until another character or the end]

I have this working in C# but I'm trying to port it over to javascript, so dropped the name capture.

    var match = mregexp.exec(mstring);

match has
    0: "$m.x"
    1: "$m.x"  // not $m.y as I would have expected.

What am i doing wrong?

thanks


