Matches HTML tags and their attributes.
/<\/?([a-zA-Z0-9]+)(?:\s+[^>]+)?>/gconst regex = /<\/?([a-zA-Z0-9]+)(?:\s+[^>]+)?>/g;
const str = '<div>test</div>';
const tags = str.match(regex);import re
regex = re.compile(r'<\/?([a-zA-Z0-9]+)(?:\s+[^>]+)?>')
tags = regex.findall('<div>test</div>')import "regexp"
re := regexp.MustCompile(`<\/?([a-zA-Z0-9]+)(?:\s+[^>]+)?>`)
tags := re.FindAllString(`<div>test</div>`, -1)use regex::Regex;
let re = Regex::new(r"<\/?([a-zA-Z0-9]+)(?:\s+[^>]+)?>").unwrap();
let tags: Vec<_> = re.find_iter("<div>test</div>").map(|m| m.as_str()).collect();