Oddly accepted RegExps

Bergi a.d.bergi at web.de
Fri Jun 3 13:12:55 UTC 2016


Jeremy Darling wrote:

> /[]]/ This one throws me, that should require the first ] to be escaped
> (\]) to be useful.  I can see it parse and accept but have no clue why or
> what it would do.  It should throw an error.

I can't see it accept anything. Afaics, it's equivalent to /[]\]/ - 
which contains an empty class that never matches anything, which is 
followed by a literal "]".

Kind regards,
  Bergi


More information about the es-discuss mailing list