The regular expression objects have the following properties.
|If this property is false, which is the default, the search stops when the first match is found. Set this to true if you want all matches.|
|Case sensitive match or not, defaults to false.|
|Search matches that may span over more than one line, defaults to false.|
|The position at which to start the search, defaults to 0.|
|Contains the regexp pattern.|
None of these properties, except for lastIndex, can be changed once the object has created.
The first three parameters represent the regex modifiers. If you create a regex object using the constructor, you can pass any combination of the following characters as a second parameter:
These letters can be in any order. If a letter is passed, the corresponding modifier is set to true. In the following example, all modifiers are set to true:
var re = new RegExp('j.*t', 'gmi');
Once set, the modifier cannot be changed:
re.global = false; re.global true
To set any modifiers using the regex literal, you add them after the closing slash.
var re = /j.*t/ig; re.global