Classes

Introduction

Character classes are denoted using the syntax "[:classname:]" within a set declaration. .

Form

var pattern = new RegExp("...e...");

Use

Example

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.