How do you match a caret (^) symbol in regex?

Escape it with a backslash:

/\^/

This will make it be interpreted as a literal ^ character.

Leave a Comment