Definition and Usage When the . modifier is set the regular expression matches the . character to all characters except newline or other li...
Definition and Usage
When the . modifier is set the regular expression matches the . character to all characters except newline or other line terminators.
Syntax
new RegExp("regexp.") OR /regexp./ |
Parameter | Description |
regexp | Required. The rest of the regular expression to use |
Example
In the following code we will do a global search for "h.t" (will find "hat"):
var str = "That's that!";
var patt1 = new RegExp("h.t","g"); |
The
marked text below shows where the RegExp gets a match: