* If specified, flags can have any combination of the following values:
* @param g
* global match
* @param i
* ignore case
* @param m
* Treat beginning and end characters (^ and $) as working over multiple lines
*
* - "g" - global match
* - "i" - ignore case
* - "m" - Treat beginning and end characters (^ and $) as working over multiple lines
* (i.e., match the beginning or end of _each_ line (delimited by \n or \r), not
* only the very beginning or end of the whole input string)
*/
@@ -332,10 +330,12 @@
//Properties
// Note that several of the RegExp properties have both long and short (Perl-like) names. Both names always refer to the same value. Perl is the programming language from which JavaScript modeled its regular expressions.
// Note that several of the RegExp properties have both long and short (Perl-like) names.
// Both names always refer to the same value. Perl is the programming language from which
// JavaScript modeled its regular expressions.
/**
* @property global
* @property {Boolean} global
* Whether to test the regular expression against all possible matches in a
* string, or only against the first.
*
@@ -348,18 +348,19 @@
*/
/**
* @property ignoreCase
* @property {Boolean} ignoreCase
* Whether to ignore case while attempting a match in a string.
*
* `ignoreCase` is a property of an individual regular expression object.
The value of `ignoreCase` is true if the "`i`" flag was used; otherwise, false. The "`i`" flag indicates that case should be ignored while attempting a match in a string.
You cannot change this property directly.
*
* The value of `ignoreCase` is true if the "`i`" flag was used; otherwise, false. The "`i`" flag indicates
* that case should be ignored while attempting a match in a string.
*
* You cannot change this property directly.
*/
/**
* @property lastIndex
* @property {Number} lastIndex
* The index at which to start the next match. A read/write integer property that specifies the index
* at which to start the next match.
*
@@ -367,24 +368,25 @@ You cannot change this property directly.
*
* This property is set only if the regular expression used the "`g`" flag to indicate a global search.
* The following rules apply:
* * If `lastIndex` is greater than the length of the string, `regexp.test` and `regexp.exec` fail,
*
* - If `lastIndex` is greater than the length of the string, `regexp.test` and `regexp.exec` fail,
* and `lastIndex` is set to 0.
* * If `lastIndex` is equal to the length of the string and if the regular expression matches the
* - If `lastIndex` is equal to the length of the string and if the regular expression matches the
* empty string, then the regular expression matches input starting at `lastIndex`.
* * If `lastIndex` is equal to the length of the string and if the regular expression does not match
* - If `lastIndex` is equal to the length of the string and if the regular expression does not match
* the empty string, then the regular expression mismatches input, and `lastIndex` is reset to 0.
* * Otherwise, `lastIndex` is set to the next position following the most recent match.
* - Otherwise, `lastIndex` is set to the next position following the most recent match.
*
* For example, consider the following sequence of statements:
*
* * `re = /(hi)?/g` Matches the empty string.
* * `re("hi")` Returns `["hi", "hi"]` with `lastIndex` equal to 2.
* * `re("hi")` Returns `[""]`, an empty array whose zeroth element is the match string. In this
* - `re = /(hi)?/g` Matches the empty string.
* - `re("hi")` Returns `["hi", "hi"]` with `lastIndex` equal to 2.
* - `re("hi")` Returns `[""]`, an empty array whose zeroth element is the match string. In this
* case, the empty string because `lastIndex` was 2 (and still is 2) and "`hi`" has length 2.
*/
/**
* @property multiline
* @property {Boolean} multiline
* Whether or not to search in strings across multiple lines.
*
* `multiline` is a property of an individual regular expression object..
@@ -398,7 +400,7 @@ You cannot change this property directly.
*/
/**
* @property source
* @property {String} source
* The text of the pattern.
*
* A read-only property that contains the text of the pattern, excluding the forward slashes.