Terminology
The Caret (^) character is also referred to by the following terms:
Usage
It has two uses in regular expressions:
[^
) it acts to negate the set of allowed characters (i.e. [123]
means the character 1, 2, or 3 is allowed, whilst the statement [^123]
means any character other than 1, 2, or 3 is allowed.Character Escaping
To express a caret without special meaning, it should be escaped by preceding it with a backslash; i.e. \^
.