I was reading Douglas Crockford’s web page, JavaScript: The World’s Most Misunderstood Programming Language, and I couldn’t help but notice that, under Design Errors, he mentions “the notation for literal regular expressions.” What exactly is he talking about? What’s wrong with JavaScript’s notation for regular expressions, and why?
I was reading Douglas Crockford’s web page, JavaScript: The World’s Most Misunderstood Programming Language
Share
Might have to do with the fact that it enforces you to escape
/characters, perhaps he wanted a more unique character to use as the notation./test//is invalid, while/test\//is a valid regex.Whereas in some languages you can actually specify the denotion character in a string, eg:
Where
#symbols do the denotion.