For javascript, debuggex conforms to the regular expression implementation in google chrome (which is mostly the same as all other browsers).
Specifically, a \n in your regex where group n doesn't exist is actually interpreted as the octal \00n.
If I recall correctly, \1(a) should match just "a" because all groups start out as being empty.
Parsing regular expressions is indeed complex, and we've got a massive suite of tests to make sure our engine works correctly (with respect to the chrome implementation, since that's what most people are using js regexes for).