Properties | |
length | - integer, number of matches after last exec or match methods calls. |
input | - string, last inspected string. |
source | - string, source code of the regular expression - string this RegExp was build from. |
index | - integer, character position where the first successful match begins in a searched string, read-only. |
lastIndex | - integer, character position where the next match begins in a searched string. |
[index] | - string | undefined, read-only, returns n-th matched fragment. Index is a zero based index, integer. |
Methods | |
RegExp |
(regular-expresion [,flags]) Used for intitalization of new instance of RegExp object. regular-expresion is a string - source of the regular expression. flags is an optional string and if provided may contain characters 'i' for case insensitive search and/or 'g' - for global search - to find all occurences of source in the input string. |
test |
(input) → true | false Checks input string to see if a pattern exists within a string and returns true if so, and false otherwise. |
exec |
(input) → null | RegExp object Returns this RegExp object with length and list of matches set if pattern exists in input string or null otherwise. |