Last active
December 27, 2022 11:27
-
-
Save Mithrandir0x/4465421 to your computer and use it in GitHub Desktop.
"Find HTML open tags" Regular Expression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Found at http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454 | |
// | |
// But beware, HTML cannot be regexed... The end is nigh. | |
var re = /<([a-z]+) *[^/]*?>/g; |
H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
Is not passing on this:
<Hello title="test" / >
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/<([\w \d \s]+)([^<]+)([^<]+) *[^\/?]>/g