JavaScript Regular Expressions: ^

By: Dusty Arlia
Published on Tuesday, September 17, 2013, 07:07 PM
Last Updated on Sunday, July 05, 2015 at 9:58 PM
Total Updates: 3

The caret (^) regular expression, signals the beginning of the string. In multiline search, the caret also matches the beginning of lines.

The ^ can also be used inside character classes. Here is an example:

/[^123abc]/

This regular expression matches any one character other than 1, 2, 3, a, b, or c. This is called a negated character class. They are made by placing the ^ at the beginning of the character class represented by the characters inside square brackets ([]).

Comments:

Ad: