Have found this out by accident and have no idea what's the reason.
// Results in "Syntax error in regular Expression".
var re = RegExp('\\');
I know that the constructor-function expects a string as parameter. And that the backslash is used within strings to escape characters with special meaning. I know that I have to escape characters like \d to \\d .
So therefore: The right backslash should the interpreted as some normal character.
Instead it throws an error. Why?
Can anyone explain this to me?