&gt; [edit] Also, the API makes less sense because JavaScript isn&#x27;t statically typed so you can make up the result object on the fly.<p>But now you need to parse the string and correctly extract named groups before flogging that to the regex engine, whereas the other way around you do some string concatenation then match back on the groups by index.