I am trying to get a regex expression to accept < and > as my outside delimiters to grab all the content in between them.
so content like such
<
You could be having a problem when you try to insert the result into HTML and the browser thinks that it is not a valid HTML tag, like <blablabla>
.
Neither <
nor >
are metacharacters inside a regular expression.
This works for me:
'<foo> and <bar>'.match(/<[^>]*>/g); // ["<foo>", "<bar>"]