JavaScript RegExp .Metacharacter
JavaScript RegExp Object
Definition and Usage
. Metacharacter is used to find a single character, except newline and line terminator.
Syntax
new RegExp("regexp.")
Or a simpler way:
/regexp./
Or a simpler way:
/regexp./
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the . metacharacter
Example
Example
Perform a global search for "h.t" in the string:
var str="That's hot!";
var patt1=/h.t/g;
var patt1=/h.t/g;
Belowmarkedtext shows where the expression gets a match
That's hot!
Try it Yourself »
JavaScript RegExp Object
Other Extensions