RegExp
Overview
The RegExp object is used for matching text with a pattern.
For more information see: RegExp (MDN).
Properties Summarized
Type | Name | Summary |
---|---|---|
Specifies if the "g" modifier is set. | ||
Specifies if the "i" modifier is set. | ||
An integer specifying the index at which to start the next match. | ||
Specifies if the "m" modifier is set. | ||
The text used for pattern matching. |
Methods Summarized
Type | Name | Summary |
---|---|---|
Search a string for a specified value. | ||
Search a string for a specified value. |
Properties Detailed
global
Specifies if the "g" modifier is set.
Type Boolean
Sample
ignoreCase
Specifies if the "i" modifier is set.
Type Boolean
Sample
lastIndex
An integer specifying the index at which to start the next match.
Type Number
Sample
multiline
Specifies if the "m" modifier is set.
Type Boolean
Sample
source
The text used for pattern matching.
Type String
Sample
Methods Detailed
exec(string)
Search a string for a specified value. Returns the found value and remembers the position.
Parameters
Object string ;
Returns: String A String representing the found value.
Sample
test(string)
Search a string for a specified value. Returns true or false.
Parameters
Object string ;
Returns: Boolean true if a match was found in the string. false otherwise.
Sample
Last updated