From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript RegExp $ Quantifier


RegExp Object Reference JavaSript RegExp Object

Definition and Usage

The n$ quantifier matches any string with n at the end of it.

Syntax

new RegExp("n$")

or

/n$/


Example

Example

Do a global search for "is" at the end of a string:

var str="Is this his";
var patt1=/is$/g;

The marked text below shows where the expression gets a match:

Is this his

Try it yourself »


RegExp Object Reference JavaSript RegExp Object

From http://www.w3schools.com (Copyright Refsnes Data)