Skip to content

Instantly share code, notes, and snippets.

@dscape
Forked from heapwolf/gist:1592949
Created January 12, 2012 04:18
Show Gist options
  • Save dscape/1598665 to your computer and use it in GitHub Desktop.
Save dscape/1598665 to your computer and use it in GitHub Desktop.
new RegExp(
[
'<',
'(/?)', // 2 - is closing
'([-:\\w]+)', // 3 - name
'((?:\\s+[-\\w]+(?:', '=', '(?:' +
'\\w+|' +
'"[^"]*"|' +
'\'[^\']*\'))?)*)', // 4 - attributes
'(/?)', // 5 - is self-closing
'>'
].join('\\s*')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment