Skip to content

Instantly share code, notes, and snippets.

@Mithrandir0x
Last active December 27, 2022 11:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mithrandir0x/4465421 to your computer and use it in GitHub Desktop.
Save Mithrandir0x/4465421 to your computer and use it in GitHub Desktop.
"Find HTML open tags" Regular Expression
// 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;
@Tusko
Copy link

Tusko commented Jun 13, 2015

/<([\w \d \s]+)([^<]+)([^<]+) *[^\/?]>/g

@RonSkons
Copy link

H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ

@hodeware
Copy link

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