Are the angle brackets (< or >) special in a regular expression?

Neither < nor > are metacharacters inside a regular expression.

This works for me:

'<foo> and <bar>'.match(/<[^>]*>/g); // ["<foo>", "<bar>"]

Leave a Comment