Test, validate and match regular expressions
This regular expression matches HTML or XML tags and specifically captures the tag name, any self-closing slashes, and up to three specified attributes (src, href, or style). It uses non-greedy matching to navigate through other arbitrary attributes inside the tag without overwriting the target captures. Developers can use this pattern for sanitizing HTML, extracting specific resource links, or modifying specific styling elements while discarding unwanted attributes.