Oddly accepted RegExps

Michael Saboff msaboff at apple.com
Fri Jun 3 17:26:19 UTC 2016


JavaScriptCore / Safari supports these three RegExp's.  Like the other implementations, I don’t think the second matches anything.

- Michael

> On Jun 3, 2016, at 6:48 AM, Andy Earnshaw <andyearnshaw at gmail.com> wrote:
> 
> IE has supported all of these for as long as I can remember.  AFAIK, it's never been a requirement _in browsers_ to escape [ inside a character class or ] outside e.g. `/[[]/` ([ is inside) or `/[]]/` (] is outside).  If it's not the case in the spec (I haven't checked the spec grammar), it should probably be classed as  a spec bug for compat reasons.
> 
> On Fri, 3 Jun 2016 at 14:20 Boris Zbarsky <bzbarsky at mit.edu <mailto:bzbarsky at mit.edu>> wrote:
> On 6/3/16 4:20 AM, Isiah Meadows wrote:
> > These three RegExps don't appear valid, even after reading the Annex B,
> > but they do behave consistently in both Chrome and Firefox.
> 
> Note that Chrome and Firefox use the same regexp implementation, so them
> agreeing on how a regexp is handled means a lot less than if two
> independent implementations agreed.
> 
> -Boris
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
> https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160603/081e0a36/attachment-0001.html>


More information about the es-discuss mailing list