?
u
m
/
The String
extends
clause of a class definition. Subclass super
call to the String When String
is called with argument value, the following steps are taken:
The String
The String.fromCharCode
function may be called with any number of arguments which form the rest parameter codeUnits. The following steps are taken:
The fromCharCode
function is
The String.fromCodePoint
function may be called with any number of arguments which form the rest parameter codePoints. The following steps are taken:
The fromCodePoint
function is
The initial value of String.prototype
is the
This property has the attributes { [[Writable]]:
The String.raw
function may be called with a variable number of arguments. The first argument is template and the remainder of the arguments form the
The raw
function is intended for use as a tag function of a Tagged Template (
The String prototype object:
Unless explicitly stated otherwise, the methods of the String prototype object defined below are not generic and the
The abstract operation thisStringValue takes argument value. It performs the following steps when called:
Returns a single element String containing the code unit at index pos within the String value resulting from converting this object to a String. If there is no element at that index, the result is the empty String. The result is a String value, not a String object.
If pos
is an x.charAt(pos)
is equivalent to the result of x.substring(pos, pos + 1)
.
When the charAt
method is called with one argument pos, the following steps are taken:
The charAt
function is intentionally generic; it does not require that its
Returns a Number (a non-negative
When the charCodeAt
method is called with one argument pos, the following steps are taken:
The charCodeAt
function is intentionally generic; it does not require that its
Returns a non-negative
When the codePointAt
method is called with one argument pos, the following steps are taken:
The codePointAt
function is intentionally generic; it does not require that its
When the concat
method is called it returns the String value consisting of the code units of the
When the concat
method is called with zero or more arguments, the following steps are taken:
The concat
method is
The concat
function is intentionally generic; it does not require that its
The initial value of String.prototype.constructor
is
The following steps are taken:
Returns
Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.
The endsWith
function is intentionally generic; it does not require that its
The includes
method takes two arguments, searchString and position, and performs the following steps:
If searchString appears as a
Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.
The includes
function is intentionally generic; it does not require that its
If searchString appears as a
The indexOf
method takes two arguments, searchString and position, and performs the following steps:
The indexOf
function is intentionally generic; it does not require that its
If searchString appears as a
The lastIndexOf
method takes two arguments, searchString and position, and performs the following steps:
The lastIndexOf
function is intentionally generic; it does not require that its
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the localeCompare
method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the localeCompare
method is used.
When the localeCompare
method is called with argument that, it returns a Number other than
Before performing the comparisons, the following steps are performed to prepare the Strings:
The meaning of the optional second and third parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not assign any other interpretation to those parameter positions.
The actual return values are 0
when comparing distinguishable Strings that are canonically equivalent.
The localeCompare
method itself is not directly suitable as an argument to Array.prototype.sort
because the latter requires a function of two arguments.
This method may rely on whatever language- and/or locale-sensitive comparison functionality is available to the ECMAScript environment from the 0
:
// Å ANGSTROM SIGN vs.
// Å LATIN CAPITAL LETTER A + COMBINING RING ABOVE
"\u212B".localeCompare("A\u030A")
// Ω OHM SIGN vs.
// Ω GREEK CAPITAL LETTER OMEGA
"\u2126".localeCompare("\u03A9")
// ṩ LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE vs.
// ṩ LATIN SMALL LETTER S + COMBINING DOT ABOVE + COMBINING DOT BELOW
"\u1E69".localeCompare("s\u0307\u0323")
// ḍ̇ LATIN SMALL LETTER D WITH DOT ABOVE + COMBINING DOT BELOW vs.
// ḍ̇ LATIN SMALL LETTER D WITH DOT BELOW + COMBINING DOT ABOVE
"\u1E0B\u0323".localeCompare("\u1E0D\u0307")
// 가 HANGUL CHOSEONG KIYEOK + HANGUL JUNGSEONG A
// 가 HANGUL SYLLABLE GA
"\u1100\u1161".localeCompare("\uAC00")
For a definition and discussion of canonical equivalence see the Unicode Standard, chapters 2 and 3, as well as Unicode Standard Annex #15, Unicode Normalization Forms and Unicode Technical Note #5, Canonical Equivalence in Applications. Also see Unicode Technical Standard #10, Unicode Collation Algorithm.
It is recommended that this method should not honour Unicode compatibility equivalents or compatibility decompositions as defined in the Unicode Standard, chapter 3, section 3.7.
The localeCompare
function is intentionally generic; it does not require that its
When the match
method is called with argument regexp, the following steps are taken:
The match
function is intentionally generic; it does not require that its
Performs a regular expression match of the String representing the
When the matchAll
method is called, the following steps are taken:
matchAll
function is intentionally generic, it does not require that its String.prototype.split
, String.prototype.matchAll
is designed to typically act without mutating its inputs.When the normalize
method is called with one argument form, the following steps are taken:
The normalize
function is intentionally generic; it does not require that its
When the padEnd
method is called, the following steps are taken:
When the padStart
method is called, the following steps are taken:
The abstract operation StringPad takes arguments O (an
The argument maxLength will be clamped such that it can be no smaller than the length of S.
The argument fillString defaults to
The abstract operation ToZeroPaddedDecimalString takes arguments n (a non-negative
The following steps are taken:
This method creates the String value consisting of the code units of the
The repeat
function is intentionally generic; it does not require that its
When the replace
method is called with arguments searchValue and replaceValue, the following steps are taken:
The replace
function is intentionally generic; it does not require that its
The abstract operation GetSubstitution takes arguments matched (a String), str (a String), position (a non-negative
When the replaceAll
method is called with arguments searchValue and replaceValue, the following steps are taken:
When the search
method is called with argument regexp, the following steps are taken:
The search
function is intentionally generic; it does not require that its
The slice
method takes two arguments, start and end, and returns a
The slice
function is intentionally generic; it does not require that its
Returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of separator; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value of separator may be a String of any length or it may be an object, such as a RegExp, that has a
When the split
method is called, the following steps are taken:
The value of separator may be an empty String. In this case, separator does not match the empty
If the
If separator is
The split
function is intentionally generic; it does not require that its
The following steps are taken:
This method returns
Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.
The startsWith
function is intentionally generic; it does not require that its
The substring
method takes two arguments, start and end, and returns a
If either argument is
If start is larger than end, they are swapped.
The following steps are taken:
The substring
function is intentionally generic; it does not require that its
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the toLocaleLowerCase
method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the toLocaleLowerCase
method is used.
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
This function works exactly the same as toLowerCase
except that it is intended to yield a locale-sensitive result corresponding with conventions of the
The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
The toLocaleLowerCase
function is intentionally generic; it does not require that its
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the toLocaleUpperCase
method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the toLocaleUpperCase
method is used.
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
This function works exactly the same as toUpperCase
except that it is intended to yield a locale-sensitive result corresponding with conventions of the
The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
The toLocaleUpperCase
function is intentionally generic; it does not require that its
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
The result must be derived according to the locale-insensitive case mappings in the Unicode Character Database (this explicitly includes not only the file UnicodeData.txt
, but also all locale-insensitive mappings in the file SpecialCasing.txt
that accompanies it).
The case mapping of some code points may produce multiple code points. In this case the result String may not be the same length as the source String. Because both toUpperCase
and toLowerCase
have context-sensitive behaviour, the functions are not symmetrical. In other words, s.toUpperCase().toLowerCase()
is not necessarily equal to s.toLowerCase()
.
The toLowerCase
function is intentionally generic; it does not require that its
When the toString
method is called, the following steps are taken:
For a String object, the toString
method happens to return the same thing as the valueOf
method.
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
This function behaves in exactly the same way as String.prototype.toLowerCase
, except that the String is mapped using the toUppercase algorithm of the Unicode Default Case Conversion.
The toUpperCase
function is intentionally generic; it does not require that its
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
The following steps are taken:
The trim
function is intentionally generic; it does not require that its
The abstract operation TrimString takes arguments string (an
The definition of white space is the union of
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
The following steps are taken:
The trimEnd
function is intentionally generic; it does not require that its
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in
The following steps are taken:
The trimStart
function is intentionally generic; it does not require that its
When the valueOf
method is called, the following steps are taken:
When the @@iterator
method is called it returns an Iterator object (
The value of the
String instances are
String instances have a
The number of elements in the String value represented by this String object.
Once a String object is initialized, this property is unchanging. It has the attributes { [[Writable]]:
A String Iterator is an object, that represents a specific iteration over some specific String instance object. There is not a named
The %StringIteratorPrototype% object:
The initial value of the
This property has the attributes { [[Writable]]:
A RegExp object contains a regular expression and the associated flags.
The form and functionality of regular expressions is modelled after the regular expression facility in the Perl 5 programming language.
The RegExp
Each \u
u
u
\u
A number of productions in this section are given alternative definitions in section
This section is amended in
The syntax-directed operation CapturingGroupNumber takes no arguments and returns a positive
This section is amended in
It is defined piecewise over the following productions:
The definitions of “the MV of
The syntax-directed operation IsCharacterClass takes no arguments and returns a Boolean.
This section is amended in
It is defined piecewise over the following productions:
The syntax-directed operation CharacterValue takes no arguments and returns a non-negative
This section is amended in
It is defined piecewise over the following productions:
ControlEscape | Numeric Value | Code Point | Unicode Name | Symbol |
---|---|---|---|---|
t
|
9 |
U+0009
|
CHARACTER TABULATION | <HT> |
n
|
10 |
U+000A
|
LINE FEED (LF) | <LF> |
v
|
11 |
U+000B
|
LINE TABULATION | <VT> |
f
|
12 |
U+000C
|
FORM FEED (FF) | <FF> |
r
|
13 |
U+000D
|
CARRIAGE RETURN (CR) | <CR> |
\0
represents the <NUL> character and cannot be followed by a decimal digit.
The syntax-directed operation SourceText takes no arguments and returns a
The syntax-directed operation CapturingGroupName takes no arguments and returns a String. It is defined piecewise over the following productions:
The syntax-directed operation RegExpIdentifierCodePoints takes no arguments and returns a
The syntax-directed operation RegExpIdentifierCodePoint takes no arguments and returns a code point. It is defined piecewise over the following productions:
A regular expression pattern is converted into an
A u
. A BMP pattern matches against a String interpreted as consisting of a sequence of 16-bit values that are Unicode code points in the range of the Basic Multilingual Plane. A Unicode pattern matches against a String interpreted as consisting of Unicode code points encoded using UTF-16. In the context of describing the behaviour of a BMP pattern “character” means a single 16-bit Unicode BMP code point. In the context of describing the behaviour of a Unicode pattern “character” means a UTF-16 encoded code point (
The syntax and semantics of
For example, consider a pattern expressed in source text as the single non-BMP character U+1D11E (MUSICAL SYMBOL G CLEF). Interpreted as a Unicode pattern, it would be a single element (character)
Patterns are passed to the RegExp
An implementation may not actually perform such translations to or from UTF-16, but the semantics of this specification requires that the result of pattern matching be as if such translations were performed.
The descriptions below use the following aliases:
(
pattern character that is matched by the (
terminal of the Furthermore, the descriptions below use the following internal data structures:
The syntax-directed operation CompilePattern takes no arguments and returns an
A Pattern compiles to an
The syntax-directed operation CompileSubpattern takes argument direction (
This section is amended in
It is defined piecewise over the following productions:
The |
regular expression operator separates two alternatives. The pattern first tries to match the left |
produce
/a|ab/.exec("abc")
returns the result
/((a)|(ab))((c)|(bc))/.exec("abc")
returns the array
["abc", "a", "a", undefined, "bc", undefined, "bc"]
and not
["abc", "ab", undefined, "ab", "c", "c", undefined]
The order in which the two alternatives are tried is independent of the value of direction.
Consecutive
The resulting Matcher is independent of direction.
The abstract operation RepeatMatcher takes arguments m (a Matcher), min (a non-negative
An
If the
Compare
/a[a-z]{2,4}/.exec("abcdefghi")
which returns
/a[a-z]{2,4}?/.exec("abcdefghi")
which returns
Consider also
/(aa|aabaac|ba|b|c)*/.exec("aabaac")
which, by the choice point ordering above, returns the array
["aaba", "ba"]
and not any of:
["aabaac", "aabaac"]
["aabaac", "c"]
The above ordering of choice points can be used to write a regular expression that calculates the greatest common divisor of two numbers (represented in unary notation). The following example calculates the gcd of 10 and 15:
"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(/^(a+)\1*,\1+$/, "$1")
which returns the gcd in unary notation
Step
/(z)((a+)?(b+)?(c))*/.exec("zaacbbbcac")
which returns the array
["zaacbbbcac", "z", "ac", "a", undefined, "c"]
and not
["zaacbbbcac", "z", "ac", "a", "bbb", "c"]
because each iteration of the outermost *
clears all captured Strings contained in the quantified
Step
/(a*)*/.exec("b")
or the slightly more complicated:
/(a*)b\1+/.exec("baaaac")
which returns the array
["b", ""]
The syntax-directed operation CompileAssertion takes no arguments and returns a Matcher.
This section is amended in
It is defined piecewise over the following productions:
Even when the y
flag is used with a pattern, ^
always matches only at the beginning of Input, or (if Multiline is
The abstract operation IsWordChar takes argument e (an
The syntax-directed operation CompileQuantifier takes no arguments and returns a
The syntax-directed operation CompileQuantifierPrefix takes no arguments and returns a
The syntax-directed operation CompileAtom takes argument direction (
This section is amended in
It is defined piecewise over the following productions:
An escape sequence of the form \
followed by a non-zero decimal number n matches the result of the nth set of capturing parentheses (
The abstract operation CharacterSetMatcher takes arguments A (a CharSet), invert (a Boolean), and direction (
The abstract operation BackreferenceMatcher takes arguments n (a positive
The abstract operation Canonicalize takes argument ch (a character) and returns a character. It performs the following steps when called:
CaseFolding.txt
of the Unicode Character Database provides a simple or common case folding mapping for ch, return the result of applying that mapping to ch.Parentheses of the form (
)
serve both to group the components of the \
followed by a non-zero decimal number), referenced in a replace String, or returned as part of an array from the regular expression matching (?:
)
instead.
The form (?=
)
specifies a zero-width positive lookahead. In order for it to succeed, the pattern inside (?=
form (this unusual behaviour is inherited from Perl). This only matters when the
For example,
/(?=(a+))/.exec("baaabac")
matches the empty String immediately after the first b
and therefore returns the array:
["", "aaa"]
To illustrate the lack of backtracking into the lookahead, consider:
/(?=(a+))a*b\1/.exec("baaabac")
This expression returns
["aba", "a"]
and not:
["aaaba", "a"]
The form (?!
)
specifies a zero-width negative lookahead. In order for it to succeed, the pattern inside
/(.*?)a(?!(a+)b\2c)\2(.*)/.exec("baaabaac")
looks for an a
not immediately followed by some positive number n of a
's, a b
, another n a
's (specified by the first \2
) and a c
. The second \2
is outside the negative lookahead, so it matches against
["baaabaac", "ba", undefined, "abaac"]
In case-insignificant matches when Unicode is ß
(U+00DF) to SS
. It may however map a code point outside the Basic Latin range to a character within, for example, ſ
(U+017F) to s
. Such characters are not mapped if Unicode is /[a-z]/i
, but they will match /[a-z]/ui
.
The syntax-directed operation CompileCharacterClass takes no arguments and returns a
The syntax-directed operation CompileToCharSet takes no arguments and returns a CharSet.
This section is amended in
It is defined piecewise over the following productions:
Even if the pattern ignores case, the case of the two ends of a range is significant in determining which characters belong to the range. Thus, for example, the pattern /[E-F]/i
matches only the letters E
, F
, e
, and f
, while the pattern /[E-f]/i
matches all uppercase and lowercase letters in the Unicode Basic Latin block as well as the symbols [
, \
, ]
, ^
, _
, and `
.
A -
character can be treated literally or it can denote a range. It is treated literally if it is the first or last character of
-
U+002D (HYPHEN-MINUS).A \b
, \B
, and backreferences. Inside a \b
means the backspace character, while \B
and backreferences raise errors. Using a backreference inside a
0
through 9
inclusive.General_Category
, s) is identical to a The abstract operation CharacterRange takes arguments A (a CharSet) and B (a CharSet) and returns a CharSet. It performs the following steps when called:
The abstract operation UnicodeMatchProperty takes argument p (a
Implementations must support the Unicode property names and aliases listed in
For example, Script_Extensions
(scx
(property alias) are valid, but script_extensions
or Scx
aren't.
The listed properties form a superset of what UTS18 RL1.2 requires.
Canonical |
|
---|---|
General_Category |
General_Category |
gc |
|
Script |
Script |
sc |
|
Script_Extensions |
Script_Extensions |
scx |
Canonical |
|
---|---|
ASCII |
ASCII |
ASCII_Hex_Digit |
ASCII_Hex_Digit |
AHex |
|
Alphabetic |
Alphabetic |
Alpha |
|
Any |
Any |
Assigned |
Assigned |
Bidi_Control |
Bidi_Control |
Bidi_C |
|
Bidi_Mirrored |
Bidi_Mirrored |
Bidi_M |
|
Case_Ignorable |
Case_Ignorable |
CI |
|
Cased |
Cased |
Changes_When_Casefolded |
Changes_When_Casefolded |
CWCF |
|
Changes_When_Casemapped |
Changes_When_Casemapped |
CWCM |
|
Changes_When_Lowercased |
Changes_When_Lowercased |
CWL |
|
Changes_When_NFKC_Casefolded |
Changes_When_NFKC_Casefolded |
CWKCF |
|
Changes_When_Titlecased |
Changes_When_Titlecased |
CWT |
|
Changes_When_Uppercased |
Changes_When_Uppercased |
CWU |
|
Dash |
Dash |
Default_Ignorable_Code_Point |
Default_Ignorable_Code_Point |
DI |
|
Deprecated |
Deprecated |
Dep |
|
Diacritic |
Diacritic |
Dia |
|
Emoji |
Emoji |
Emoji_Component |
Emoji_Component |
EComp |
|
Emoji_Modifier |
Emoji_Modifier |
EMod |
|
Emoji_Modifier_Base |
Emoji_Modifier_Base |
EBase |
|
Emoji_Presentation |
Emoji_Presentation |
EPres |
|
Extended_Pictographic |
Extended_Pictographic |
ExtPict |
|
Extender |
Extender |
Ext |
|
Grapheme_Base |
Grapheme_Base |
Gr_Base |
|
Grapheme_Extend |
Grapheme_Extend |
Gr_Ext |
|
Hex_Digit |
Hex_Digit |
Hex |
|
IDS_Binary_Operator |
IDS_Binary_Operator |
IDSB |
|
IDS_Trinary_Operator |
IDS_Trinary_Operator |
IDST |
|
ID_Continue |
ID_Continue |
IDC |
|
ID_Start |
ID_Start |
IDS |
|
Ideographic |
Ideographic |
Ideo |
|
Join_Control |
Join_Control |
Join_C |
|
Logical_Order_Exception |
Logical_Order_Exception |
LOE |
|
Lowercase |
Lowercase |
Lower |
|
Math |
Math |
Noncharacter_Code_Point |
Noncharacter_Code_Point |
NChar |
|
Pattern_Syntax |
Pattern_Syntax |
Pat_Syn |
|
Pattern_White_Space |
Pattern_White_Space |
Pat_WS |
|
Quotation_Mark |
Quotation_Mark |
QMark |
|
Radical |
Radical |
Regional_Indicator |
Regional_Indicator |
RI |
|
Sentence_Terminal |
Sentence_Terminal |
STerm |
|
Soft_Dotted |
Soft_Dotted |
SD |
|
Terminal_Punctuation |
Terminal_Punctuation |
Term |
|
Unified_Ideograph |
Unified_Ideograph |
UIdeo |
|
Uppercase |
Uppercase |
Upper |
|
Variation_Selector |
Variation_Selector |
VS |
|
White_Space |
White_Space |
space |
|
XID_Continue |
XID_Continue |
XIDC |
|
XID_Start |
XID_Start |
XIDS |
The abstract operation UnicodeMatchPropertyValue takes arguments p (a
Implementations must support the Unicode property value names and aliases listed in
For example, Xpeo
and Old_Persian
are valid Script_Extensions
values, but xpeo
and Old Persian
aren't.
This algorithm differs from the matching rules for symbolic values listed in UAX44: case, Is
prefix is not supported.
The spellings of entries in these tables (including casing) were chosen to match the first occurrence of each property in the files PropertyAliases.txt
and PropertyValueAliases.txt
in the Unicode Character Database at the time each entry was added to this specification. However, because the precise spellings in those files are not guaranteed to be stable, implementations are required to follow this table rather than those files.
General_Category
Property value and aliases | Canonical property value |
---|---|
Cased_Letter |
Cased_Letter |
LC |
|
Close_Punctuation |
Close_Punctuation |
Pe |
|
Connector_Punctuation |
Connector_Punctuation |
Pc |
|
Control |
Control |
Cc |
|
cntrl |
|
Currency_Symbol |
Currency_Symbol |
Sc |
|
Dash_Punctuation |
Dash_Punctuation |
Pd |
|
Decimal_Number |
Decimal_Number |
Nd |
|
digit |
|
Enclosing_Mark |
Enclosing_Mark |
Me |
|
Final_Punctuation |
Final_Punctuation |
Pf |
|
Format |
Format |
Cf |
|
Initial_Punctuation |
Initial_Punctuation |
Pi |
|
Letter |
Letter |
L |
|
Letter_Number |
Letter_Number |
Nl |
|
Line_Separator |
Line_Separator |
Zl |
|
Lowercase_Letter |
Lowercase_Letter |
Ll |
|
Mark |
Mark |
M |
|
Combining_Mark |
|
Math_Symbol |
Math_Symbol |
Sm |
|
Modifier_Letter |
Modifier_Letter |
Lm |
|
Modifier_Symbol |
Modifier_Symbol |
Sk |
|
Nonspacing_Mark |
Nonspacing_Mark |
Mn |
|
Number |
Number |
N |
|
Open_Punctuation |
Open_Punctuation |
Ps |
|
Other |
Other |
C |
|
Other_Letter |
Other_Letter |
Lo |
|
Other_Number |
Other_Number |
No |
|
Other_Punctuation |
Other_Punctuation |
Po |
|
Other_Symbol |
Other_Symbol |
So |
|
Paragraph_Separator |
Paragraph_Separator |
Zp |
|
Private_Use |
Private_Use |
Co |
|
Punctuation |
Punctuation |
P |
|
punct |
|
Separator |
Separator |
Z |
|
Space_Separator |
Space_Separator |
Zs |
|
Spacing_Mark |
Spacing_Mark |
Mc |
|
Surrogate |
Surrogate |
Cs |
|
Symbol |
Symbol |
S |
|
Titlecase_Letter |
Titlecase_Letter |
Lt |
|
Unassigned |
Unassigned |
Cn |
|
Uppercase_Letter |
Uppercase_Letter |
Lu |
Script
and Script_Extensions
Property value and aliases | Canonical property value |
---|---|
Adlam |
Adlam |
Adlm |
|
Ahom |
Ahom |
Anatolian_Hieroglyphs |
Anatolian_Hieroglyphs |
Hluw |
|
Arabic |
Arabic |
Arab |
|
Armenian |
Armenian |
Armn |
|
Avestan |
Avestan |
Avst |
|
Balinese |
Balinese |
Bali |
|
Bamum |
Bamum |
Bamu |
|
Bassa_Vah |
Bassa_Vah |
Bass |
|
Batak |
Batak |
Batk |
|
Bengali |
Bengali |
Beng |
|
Bhaiksuki |
Bhaiksuki |
Bhks |
|
Bopomofo |
Bopomofo |
Bopo |
|
Brahmi |
Brahmi |
Brah |
|
Braille |
Braille |
Brai |
|
Buginese |
Buginese |
Bugi |
|
Buhid |
Buhid |
Buhd |
|
Canadian_Aboriginal |
Canadian_Aboriginal |
Cans |
|
Carian |
Carian |
Cari |
|
Caucasian_Albanian |
Caucasian_Albanian |
Aghb |
|
Chakma |
Chakma |
Cakm |
|
Cham |
Cham |
Chorasmian |
Chorasmian |
Chrs |
|
Cherokee |
Cherokee |
Cher |
|
Common |
Common |
Zyyy |
|
Coptic |
Coptic |
Copt |
|
Qaac |
|
Cuneiform |
Cuneiform |
Xsux |
|
Cypriot |
Cypriot |
Cprt |
|
Cypro_Minoan |
Cypro_Minoan |
Cpmn |
|
Cyrillic |
Cyrillic |
Cyrl |
|
Deseret |
Deseret |
Dsrt |
|
Devanagari |
Devanagari |
Deva |
|
Dives_Akuru |
Dives_Akuru |
Diak |
|
Dogra |
Dogra |
Dogr |
|
Duployan |
Duployan |
Dupl |
|
Egyptian_Hieroglyphs |
Egyptian_Hieroglyphs |
Egyp |
|
Elbasan |
Elbasan |
Elba |
|
Elymaic |
Elymaic |
Elym |
|
Ethiopic |
Ethiopic |
Ethi |
|
Georgian |
Georgian |
Geor |
|
Glagolitic |
Glagolitic |
Glag |
|
Gothic |
Gothic |
Goth |
|
Grantha |
Grantha |
Gran |
|
Greek |
Greek |
Grek |
|
Gujarati |
Gujarati |
Gujr |
|
Gunjala_Gondi |
Gunjala_Gondi |
Gong |
|
Gurmukhi |
Gurmukhi |
Guru |
|
Han |
Han |
Hani |
|
Hangul |
Hangul |
Hang |
|
Hanifi_Rohingya |
Hanifi_Rohingya |
Rohg |
|
Hanunoo |
Hanunoo |
Hano |
|
Hatran |
Hatran |
Hatr |
|
Hebrew |
Hebrew |
Hebr |
|
Hiragana |
Hiragana |
Hira |
|
Imperial_Aramaic |
Imperial_Aramaic |
Armi |
|
Inherited |
Inherited |
Zinh |
|
Qaai |
|
Inscriptional_Pahlavi |
Inscriptional_Pahlavi |
Phli |
|
Inscriptional_Parthian |
Inscriptional_Parthian |
Prti |
|
Javanese |
Javanese |
Java |
|
Kaithi |
Kaithi |
Kthi |
|
Kannada |
Kannada |
Knda |
|
Katakana |
Katakana |
Kana |
|
Kayah_Li |
Kayah_Li |
Kali |
|
Kharoshthi |
Kharoshthi |
Khar |
|
Khitan_Small_Script |
Khitan_Small_Script |
Kits |
|
Khmer |
Khmer |
Khmr |
|
Khojki |
Khojki |
Khoj |
|
Khudawadi |
Khudawadi |
Sind |
|
Lao |
Lao |
Laoo |
|
Latin |
Latin |
Latn |
|
Lepcha |
Lepcha |
Lepc |
|
Limbu |
Limbu |
Limb |
|
Linear_A |
Linear_A |
Lina |
|
Linear_B |
Linear_B |
Linb |
|
Lisu |
Lisu |
Lycian |
Lycian |
Lyci |
|
Lydian |
Lydian |
Lydi |
|
Mahajani |
Mahajani |
Mahj |
|
Makasar |
Makasar |
Maka |
|
Malayalam |
Malayalam |
Mlym |
|
Mandaic |
Mandaic |
Mand |
|
Manichaean |
Manichaean |
Mani |
|
Marchen |
Marchen |
Marc |
|
Medefaidrin |
Medefaidrin |
Medf |
|
Masaram_Gondi |
Masaram_Gondi |
Gonm |
|
Meetei_Mayek |
Meetei_Mayek |
Mtei |
|
Mende_Kikakui |
Mende_Kikakui |
Mend |
|
Meroitic_Cursive |
Meroitic_Cursive |
Merc |
|
Meroitic_Hieroglyphs |
Meroitic_Hieroglyphs |
Mero |
|
Miao |
Miao |
Plrd |
|
Modi |
Modi |
Mongolian |
Mongolian |
Mong |
|
Mro |
Mro |
Mroo |
|
Multani |
Multani |
Mult |
|
Myanmar |
Myanmar |
Mymr |
|
Nabataean |
Nabataean |
Nbat |
|
Nandinagari |
Nandinagari |
Nand |
|
New_Tai_Lue |
New_Tai_Lue |
Talu |
|
Newa |
Newa |
Nko |
Nko |
Nkoo |
|
Nushu |
Nushu |
Nshu |
|
Nyiakeng_Puachue_Hmong |
Nyiakeng_Puachue_Hmong |
Hmnp |
|
Ogham |
Ogham |
Ogam |
|
Ol_Chiki |
Ol_Chiki |
Olck |
|
Old_Hungarian |
Old_Hungarian |
Hung |
|
Old_Italic |
Old_Italic |
Ital |
|
Old_North_Arabian |
Old_North_Arabian |
Narb |
|
Old_Permic |
Old_Permic |
Perm |
|
Old_Persian |
Old_Persian |
Xpeo |
|
Old_Sogdian |
Old_Sogdian |
Sogo |
|
Old_South_Arabian |
Old_South_Arabian |
Sarb |
|
Old_Turkic |
Old_Turkic |
Orkh |
|
Old_Uyghur |
Old_Uyghur |
Ougr |
|
Oriya |
Oriya |
Orya |
|
Osage |
Osage |
Osge |
|
Osmanya |
Osmanya |
Osma |
|
Pahawh_Hmong |
Pahawh_Hmong |
Hmng |
|
Palmyrene |
Palmyrene |
Palm |
|
Pau_Cin_Hau |
Pau_Cin_Hau |
Pauc |
|
Phags_Pa |
Phags_Pa |
Phag |
|
Phoenician |
Phoenician |
Phnx |
|
Psalter_Pahlavi |
Psalter_Pahlavi |
Phlp |
|
Rejang |
Rejang |
Rjng |
|
Runic |
Runic |
Runr |
|
Samaritan |
Samaritan |
Samr |
|
Saurashtra |
Saurashtra |
Saur |
|
Sharada |
Sharada |
Shrd |
|
Shavian |
Shavian |
Shaw |
|
Siddham |
Siddham |
Sidd |
|
SignWriting |
SignWriting |
Sgnw |
|
Sinhala |
Sinhala |
Sinh |
|
Sogdian |
Sogdian |
Sogd |
|
Sora_Sompeng |
Sora_Sompeng |
Sora |
|
Soyombo |
Soyombo |
Soyo |
|
Sundanese |
Sundanese |
Sund |
|
Syloti_Nagri |
Syloti_Nagri |
Sylo |
|
Syriac |
Syriac |
Syrc |
|
Tagalog |
Tagalog |
Tglg |
|
Tagbanwa |
Tagbanwa |
Tagb |
|
Tai_Le |
Tai_Le |
Tale |
|
Tai_Tham |
Tai_Tham |
Lana |
|
Tai_Viet |
Tai_Viet |
Tavt |
|
Takri |
Takri |
Takr |
|
Tamil |
Tamil |
Taml |
|
Tangsa |
Tangsa |
Tnsa |
|
Tangut |
Tangut |
Tang |
|
Telugu |
Telugu |
Telu |
|
Thaana |
Thaana |
Thaa |
|
Thai |
Thai |
Tibetan |
Tibetan |
Tibt |
|
Tifinagh |
Tifinagh |
Tfng |
|
Tirhuta |
Tirhuta |
Tirh |
|
Toto |
Toto |
Ugaritic |
Ugaritic |
Ugar |
|
Vai |
Vai |
Vaii |
|
Vithkuqi |
Vithkuqi |
Vith |
|
Wancho |
Wancho |
Wcho |
|
Warang_Citi |
Warang_Citi |
Wara |
|
Yezidi |
Yezidi |
Yezi |
|
Yi |
Yi |
Yiii |
|
Zanabazar_Square |
Zanabazar_Square |
Zanb |
The RegExp
RegExp(…)
is equivalent to the object creation expression new RegExp(…)
with the same arguments.extends
clause of a class definition. Subclass super
call to the RegExp The following steps are taken:
If pattern is supplied using a
The abstract operation RegExpAlloc takes argument newTarget and returns either a
The abstract operation RegExpInitialize takes arguments obj (an Object), pattern (an
The abstract operation ParsePattern takes arguments patternText (a sequence of Unicode code points) and u (a Boolean) and returns a
The abstract operation RegExpCreate takes arguments P and F and returns either a
The abstract operation EscapeRegExpPattern takes arguments P and F and returns a String. It performs the following steps when called:
/
or any ///
followed by F would be parsed as a The RegExp
The initial value of RegExp.prototype
is the
This property has the attributes { [[Writable]]:
RegExp[@@species]
is an
The value of the
RegExp prototype methods normally use their
The RegExp prototype object:
The RegExp prototype object does not have a
The initial value of RegExp.prototype.constructor
is
Performs a regular expression match of string against the regular expression and returns an Array containing the results of the match, or
The String
The abstract operation RegExpExec takes arguments R (an Object) and S (a String) and returns either a
If a callable
The abstract operation RegExpBuiltinExec takes arguments R (an initialized RegExp instance) and S (a String) and returns either a
The abstract operation AdvanceStringIndex takes arguments S (a String), index (a non-negative
The abstract operation GetStringIndex takes arguments S (a String) and e (a non-negative
A Match Record is a
Match Records have the fields listed in
Field Name | Value | Meaning |
---|---|---|
[[StartIndex]] | a non-negative |
The number of code units from the start of a string at which the match begins (inclusive). |
[[EndIndex]] | an |
The number of code units from the start of a string at which the match ends (exclusive). |
The abstract operation GetMatchString takes arguments S (a String) and match (a
The abstract operation GetMatchIndexPair takes arguments S (a String) and match (a
The abstract operation MakeMatchIndicesIndexPairArray takes arguments S (a String), indices (a
RegExp.prototype.dotAll
is an
The abstract operation RegExpHasFlag takes arguments R (an
RegExp.prototype.flags
is an
RegExp.prototype.global
is an
RegExp.prototype.hasIndices
is an
RegExp.prototype.ignoreCase
is an
When the @@match
method is called with argument string, the following steps are taken:
The value of the
The
When the @@matchAll
method is called with argument string, the following steps are taken:
The value of the
RegExp.prototype.multiline
is an
When the @@replace
method is called with arguments string and replaceValue, the following steps are taken:
The value of the
When the @@search
method is called with argument string, the following steps are taken:
The value of the
The
RegExp.prototype.source
is an
Returns an Array into which substrings of the result of converting string to a String have been stored. The substrings are determined by searching from left to right for matches of the
The /a*?/[Symbol.split]("ab")
evaluates to the array ["a", "b"]
, while /a*/[Symbol.split]("ab")
evaluates to the array ["","b"]
.)
If string is (or converts to) the empty String, the result depends on whether the regular expression can match the empty String. If it can, the result array contains no elements. Otherwise, the result array contains one element, which is the empty String.
If the regular expression contains capturing parentheses, then each time separator is matched the results (including any
/<(\/)?([^<>]+)>/[Symbol.split]("A<B>bold</B>and<CODE>coded</CODE>")
evaluates to the array
["A", undefined, "B", "bold", "/", "B", "and", undefined, "CODE", "coded", "/", "CODE", ""]
If limit is not
When the @@split
method is called, the following steps are taken:
The value of the
The @@split
method ignores the value of the
RegExp.prototype.sticky
is an
The following steps are taken:
The returned String has the form of a
RegExp.prototype.unicode
is an
RegExp instances are
Prior to ECMAScript 2015, RegExp instances were specified as having the own RegExp.prototype
.
RegExp instances also have the following property:
The value of the
A RegExp String Iterator is an object, that represents a specific iteration over some specific String instance object, matching against some specific RegExp instance object. There is not a named
The abstract operation CreateRegExpStringIterator takes arguments R (an Object), S (a String), global (a Boolean), and fullUnicode (a Boolean) and returns a Generator. It performs the following steps when called:
The %RegExpStringIteratorPrototype% object:
The initial value of the
This property has the attributes { [[Writable]]: