RegExp $ quantifier
Definition and Usage
n$ quantifier matches any string withnend.
grammar
new RegExp("n$")
或者
/n$/
或者
/n$/
Browser Support
All major browsers support $ quantifier
Examples
Examples
On the end of the string "is" a global search ::
var str="Is this his";
var patt1=/is$/g;
var patt1=/is$/g;
Surface marked text shows where the expression gets a match:
Is this h is
try it"
JavaSript RegExp objects