RegExp
Wraps a regular expression.
Go to Property Listing | Method Listing
Methods:
Property Listing
Name |
Type |
Access |
Description |
---|---|---|---|
readonly |
The matched subexpression #1. |
||
readonly |
The matched subexpression #2. |
||
readonly |
The matched subexpression #3. |
||
readonly |
The matched subexpression #4. |
||
readonly |
The matched subexpression #5. |
||
readonly |
The matched subexpression #6. |
||
readonly |
The matched subexpression #7. |
||
readonly |
The matched subexpression #8. |
||
readonly |
The matched subexpression #9. |
||
readonly |
Indicates whether the match is a global match. |
||
readonly |
Indicates whether the match is not case sensitive. |
||
readonly |
The original input string. |
||
readonly |
The last match. |
||
readonly |
The value of the last matched subexpression. |
||
readonly |
The string before the match. |
||
readonly |
Indicates whether the match matches multiple lines. |
||
readonly |
The string after the match. |
Method Listing
Constructor
RegExp 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 |
The pattern to convert. |
|
flags |
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 |
Boolean compile (pattern:String)
Compiles a string to a regular expression. Returns true if the compilation was successful.
Parameter |
Type |
Description |
---|---|---|
pattern |
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 |
The string to match. |
Boolean test (text:String)
Execute a regular expression, and return true if there is a match.
Parameter |
Type |
Description |
---|---|---|
text |
The string to match. |
String toString ()
Converts this RegExp object to a string.