P. 1
Ecma-262

Ecma-262

|Views: 22|Likes:
Published by anon-238256

More info:

Published by: anon-238256 on Jul 11, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/08/2014

pdf

text

original

The RegExp constructor applies the following grammar to the input pattern string. An error occurs if
the grammar cannot interpret the string as an expansion of Pattern.

Syntax

Pattern ::

Disjunction

Disjunction ::

Alternative
Alternative
| Disjunction

Alternative ::

[empty]

Alternative Term

- 130 -

Term ::

Assertion
Atom
Atom Quantifier

Assertion ::

^
$
\ b
\ B

Quantifier ::

QuantifierPrefix
QuantifierPrefix
?

QuantifierPrefix ::

*
+
?
{
DecimalDigits }
{
DecimalDigits , }
{
DecimalDigits , DecimalDigits }

Atom ::

PatternCharacter

.

\ AtomEscape
CharacterClass
( Disjunction )
( ? :
Disjunction )
( ? =
Disjunction )
( ? !
Disjunction )

PatternCharacter :: SourceCharacter but not any of:

^ $ \ . * + ? ( ) [ ] { } |

AtomEscape ::

DecimalEscape
CharacterEscape
CharacterClassEscape

CharacterEscape ::
ControlEscape
c ControlLetter
HexEscapeSequence
UnicodeEscapeSequence
IdentityEscape

ControlEscape :: one of

f n r t v

ControlLetter :: one of

a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

IdentityEscape ::

SourceCharacter but not IdentifierPart

- 131 -

DecimalEscape ::

DecimalIntegerLiteral [lookahead∉ DecimalDigit]

CharacterClassEscape :: one of

d D s S w W

CharacterClass ::

[ [lookahead∉ {^}] ClassRanges ]
[ ^
ClassRanges ]

ClassRanges ::

[empty]

NonemptyClassRanges

NonemptyClassRanges ::
ClassAtom
ClassAtom NonemptyClassRangesNoDash
ClassAtom
- ClassAtom ClassRanges

NonemptyClassRangesNoDash ::
ClassAtom
ClassAtomNoDash NonemptyClassRangesNoDash
ClassAtomNoDash
- ClassAtom ClassRanges

ClassAtom ::

-

ClassAtomNoDash

ClassAtomNoDash ::

SourceCharacter but not one of \ ] -
\
ClassEscape

ClassEscape ::

DecimalEscape

b

CharacterEscape
CharacterClassEscape

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->