Java Reference
In-Depth Information
regexp
The RegExp object is used to find patterns within string values. RegExp objects can be created in
two ways: using the RegExp constructor or a text literal. It was introduced in JavaScript 1.2.
Some of the properties in the following table have both long and short names. The short names are
derived from the Perl programming language.
Properties
property
introduced
description
JavaScript 1.2
Used to reference the constructor function for the object.
constructor
JavaScript 1.2
Indicates whether all possible matches in the string are to
be made, or only the first. Corresponds to the g flag.
global
JavaScript 1.2
Indicates whether the match is to be caseā€insensitive.
Corresponds to the i flag.
ignoreCase
JavaScript 1.2
The string against which the regular expression is
matched.
input
JavaScript 1.2
The position in the string from which the next match is to
be started.
lastIndex
JavaScript 1.2
Indicates whether strings are to be searched across
multiple lines. Corresponds with the m flag.
multiline
JavaScript 1.2
Returns the prototype for the object, which can be used to
extend the object's interface.
prototype
JavaScript 1.2
The text of the pattern for the regular expression.
source
Methods
Method
introduced
description
JavaScript 1.2
Executes a search for a match in the string
parameter passed in.
exec(stringToSearch)
JavaScript 1.2
Tests for a match in the string parameter
passed in.
test(stringToMatch)
JavaScript 1.2
Converts the RegExp object into a string.
toString()
JavaScript 1.2
Returns the primitive value of the RegExp
object.
valueOf()
Search WWH ::




Custom Search