do-while grammar

André Bargull andre.bargull at
Tue Feb 8 15:35:52 PST 2011

On 2/8/2011 11:41 PM, Allen Wirfs-Brock wrote:
> see below
> On Feb 8, 2011, at 2:01 PM, Mark S. Miller wrote:
>> Does anyone know of any other syntax that all major JS engines accept
>> that are not in the official ES5.1 grammar?
> Yes, various RegExp syntax discrepancies are know to exist. Somebody
> needs to catalog them.

Especially the discrepancies which are visible when executing the few 
RegExp examples from the ES3/ES5 specification are quite amusing.

"A<B>bold</B>and<CODE>coded</CODE>".split(new RegExp("<(/)?([^<>]+)>"))
=> Wrong result in Firefox/IE

"ab".split(new RegExp("a*"))
=> Wrong result in IE

new RegExp("((a)|(ab))((c)|(bc))").exec("abc")
=> Wrong result in IE

new RegExp("(z)((a+)?(b+)?(c))*").exec("zaacbbbcac")
=> Wrong result in Safari/IE

new RegExp("(.*?)a(?!(a+)b\\2c)\\2(.*)").exec("baaabaac")
=> Wrong result in Safari/IE

(Tested with current IE, Firefox, Safari, Opera)

More information about the es-discuss mailing list