JavaScript RegExp $ quantifier
The JavaScript RegExp object
Definition and Usage
nThe $ quantifier matches any string ending with n the specified string.
Syntax
new RegExp("
n
$")
or
/
n
$/
Browser support





All major browsers support the $ quantifier
Example
Example
Perform a global search for "is" at the end of a string:
var str="Is this his";
var patt1=/is$/g;
The text marked below shows where the expression found matches:
Is this h
is
Try it »
The JavaScript RegExp object