JavaScript RegExp $Quantifier
JavaScript RegExp Object
Definition and Usage
nThe $ quantifier matches any string ending withnthe string.
Syntax
new RegExp("n$")
or
/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;
var patt1=/is$/g;
FaceMarkedtext shows where the expression gets a match:
Is this his
Try it yourself »
JavaScript RegExp Object Other Extensions