Neither <
nor >
are metacharacters inside a regular expression.
This works for me:
'<foo> and <bar>'.match(/<[^>]*>/g); // ["<foo>", "<bar>"]
More Related Contents:
- Regex – To allow numeric, only characters R, N, X, B, @ [closed]
- Find particular string from URL in JavaScript
- Regex for Email Address along with name format [duplicate]
- JavaScript regex multiline text between two tags
- Case insensitive regex in JavaScript
- I want to remove double quotes from a String
- Count number of matches of a regex in Javascript
- Password REGEX with min 6 chars, at least one letter and one number and may contain special characters
- Regex created via new RegExp(myString) not working (backslashes)
- Replace a Regex capture group with uppercase in Javascript
- Regular Expression | Leap Years and More
- Replacing from javascript dom text node
- Javascript Regex to replace text NOT in html attributes [duplicate]
- Javascript – Regex to validate date format [duplicate]
- Replacing the nth instance of a regex match in Javascript
- How to extract a string using JavaScript Regex?
- JavaScript Regex Global Match Groups
- What does the regular expression /_/g mean?
- Interesting test of Javascript RegExp [duplicate]
- Javascript Regex to match only a single occurrence no more or less
- Highlight current page in jquery
- Highlight word in HTML text (but not markup)
- All characters in a string must match regex
- Regex eError when using {1}+ possessive quantifier in JavaScript regex
- Check if string contains only letters in javascript
- regular expression to validate datetime format (MM/DD/YYYY) [duplicate]
- What’s different between Python and Javascript regular expressions?
- Extract keyword from Google search in Javascript
- Regex matching emoticons
- Regex: only alphanumeric but not if this is pure numeric