Character classes are denoted using the syntax "[:classname:]" within a set declaration. .
var pattern = new RegExp("...e...");
The following is the code.
var pattern = new RegExp("^e$"); var string = "TreeLeaves"; document.writeln(pattern.test(string));
On running the above code, the following output is obtained.