On Oct 30, 2010, at 4:49 AM, Michael Day wrote:
> /foo\$bar/.exec("foo$bar")
This works in all browsers I can test atm (Chrome, Firefox, Opera, Safari).
It's an old de-facto standard, going back to the dawn of RegExp in Netscape
4-era SpiderMonkey (pre-ES3), and based on lots of Unix precedent: \ followed
by any non-special char means literal next.
It is a bit future-hostile, or was 12 years ago -- we can't add more escapes
easily. But that decision can't be recalled and changed, and anyway, a fixed
set of escapes may be best on the Web.
ES3 and ES5 didn't codify it. Harmony should. Thanks for pointing it out.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss