ConstructorRegExp RegExp (pattern:
string[, flags:
string])
Creates and returns a new RegExp object set to the value of the argument converted to a regular expression.
Parameter | Type | Description |
pattern | string | The pattern to convert. |
flags | string | Flags that control how the conversion is performed. A string containing any combination of the letters i, m, g:
• "i" -- ignore case in pattern matching
• "m" -- treat the string as multiple lines
• "g" -- do global pattern matching (Optional) |
Instancesbool compile (pattern:
string)
Compiles a string to a regular expression. Returns true if the compilation was successful.
Parameter | Type | Description |
pattern | string | The pattern to compile. |
Array exec (text:
string)
Execute a regular expression.
The return value is an array of matches, with the first element containing the match, and successive elements containing the results of any matching subexpression in their order of appearance. If there is no match, the result is null.
Parameter | Type | Description |
text | string | The string to match. |
bool test (text:
string)
Execute a regular expression, and return true if there is a match.
Parameter | Type | Description |
text | string | The string to match. |
string toString ()
Converts this RegExp object to a string.
|