[sent this to es3.x-discuss by mistake, sorry for any duplicates]

Hi,

Is \$ valid inside regexps? For example:

xs = /foo\$bar/.exec("foo$bar");

This matches in Firefox. However, the spec would appear to forbid this interpretation, unless I'm confused again:

IdentifierStart :: $

IdentifierPart :: IdentifierStart

IdentityEscape :: SourceCharacter but not IdentifierPart

CharacterEscape :: IdentityEscape

AtomEscape :: CharacterEscape

Atom :: \ AtomEscape

From these rules it seems that \$ is forbidden, and the only way to match a $ is to use a HexEscapeSequence or UnicodeEscapeSequence.

So is this a spec bug? It seems to be present in ES3 and ES5.

Or a Firefox extension?

Best regards,

Michael

--
Print XML with Prince!
http://www.princexml.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to