{ and } in regexps

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

{ and } in regexps

Michael Day
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
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

RE: { and } in regexps

Allen Wirfs-Brock-2
I don't think so.  See http://blogs.msdn.com/b/ie/archive/2010/08/25/chakra-interoperability-means-more-than-just-standards.aspx 

Hopefully for Harmony somebody will take on the challenge of updating the RegExp spec. to reflect reality.  We need a software archeologist to analyze the major browsers what the consensus spec. really is.

Allen

> -----Original Message-----
> From: [hidden email] [mailto:es-discuss-
> [hidden email]] On Behalf Of Michael Day
> Sent: Thursday, November 11, 2010 11:59 PM
> To: ES-Discuss
> Subject: { and } in regexps
>
> 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
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: { and } in regexps

Brendan Eich-3
On Nov 12, 2010, at 8:08 AM, Allen Wirfs-Brock wrote:

> I don't think so.  See http://blogs.msdn.com/b/ie/archive/2010/08/25/chakra-interoperability-means-more-than-just-standards.aspx 
>
> Hopefully for Harmony somebody will take on the challenge of updating the RegExp spec. to reflect reality.  We need a software archeologist to analyze the major browsers what the consensus spec. really is.

We have such an archeologist, in my opinion. See

http://blog.stevenlevithan.com/

https://bugzilla.mozilla.org/buglist.cgi?emailassigned_to1=1&query_format=advanced&emailcc1=1&emaillongdesc1=1&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&email1=steves_list&emailtype1=substring

/be


>
> Allen
>
>> -----Original Message-----
>> From: [hidden email] [mailto:es-discuss-
>> [hidden email]] On Behalf Of Michael Day
>> Sent: Thursday, November 11, 2010 11:59 PM
>> To: ES-Discuss
>> Subject: { and } in regexps
>>
>> 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
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss