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 beginning of it.

Syntax

new RegExp("^n")

or

/^n/


Example

Example

Do a global search for "Is" at the beginning 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)