|
|
Regular Expression Object
|
Regexp Instance Properties
|
global |
True if the regexp had the /g flag.
|
ignoreCase |
True if the regexp ignores case, i.e. it had the /i flag.
|
lastIndex |
Index into the string telling where to start the next match.
|
source |
The regexp source.
|
compile(pattern [, flags]) |
Recompiles the regular expression.
|
exec([string]) |
Returns an array of the substring matches and sets the regexp and
RegExp object variables. |
(string) |
Same as exec(string) .
|
test(string) |
True if string matches the regular expression. |
Default string to match.
lastMatch $&
| JavaScript 1.2 |
Last matched characters.
lastParen $+
| JavaScript 1.2 |
Last substring match.
leftContext $`
| JavaScript 1.2 |
The string before the match.
rightContext $'
| JavaScript 1.2 |
The string after the match.
$1, ..., $9
| JavaScript 1.2 |
Substring matches.
RegExp(pattern [, flags])
| JavaScript 1.2 |
Compiles a regular expression.
Regexp Instance Properties
|
True if the regexp had the /g flag.
ignoreCase
| JavaScript 1.2 |
True if the regexp ignores case, i.e. it had the /i flag.
Index into the string telling where to start the next match.
The regexp source.
compile(pattern [, flags])
| JavaScript 1.2 |
Recompiles the regular expression.
Returns an array of the substring matches and sets the regexp and
RegExp object variables. exec returns null if the
regexp does not match. The first element in the array is the entire match.
The returned array sets the property index to the
index of the match and sets input to the tested string.
If string is missing, exec uses the value
of RegExp.input .
a = /a(.)c/g;
foo = a.exec("left_axc_right");
|
foo.join() axc,x
foo.index 5
foo.input left_axc_right
a.lastIndex 8
RegExp.lastMatch axc
RegExp.lastParen x
RegExp.leftContext left_
RegExp.rightContext _right
RegExp.$1 x
RegExp.$2 ""
|
Same as exec(string) .
test(string)
| JavaScript 1.2 |
True if string matches the regular expression.
test does not set any variables.
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:54:28 -0800 (PST)
|