{ and } in regexps

Michael Day mikeday at yeslogic.com
Thu Nov 11 23:58:50 PST 2010


Hi,

Browsers seem to allow { and } to occur in regexps unescaped, if the 
position does not conflict with their use as a quantifier. For example:

/foo|{bar}/

However, ES3 and ES5 forbid this, as PatternCharacter does not include { 
or } or any of the other significant punctuation.

Given that every new implementation ends up having to do what all the 
existing implementations do, is there any reason for the spec to differ?

Best regards,

Michael

-- 
Print XML with Prince!
http://www.princexml.com


More information about the es-discuss mailing list