JavaScript RegExp ^ quantifier
The JavaScript RegExp object
Definition and Usage
^nThe quantifier matches any string beginning 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 start of a string:
var str="Is this his";
var patt1=/^Is/g;
The text marked below shows where the expression found matches:
Is
this his
Try it »
The JavaScript RegExp object