Created
January 11, 2012 04:05
-
-
Save heapwolf/1592949 to your computer and use it in GitHub Desktop.
This file contains 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
new RegExp( | |
[ | |
'<', | |
'(/?)', // 2 - is closing | |
'([-:\\w]+)', // 3 - name | |
'((?:\\s+[-\\w]+(?:', '=', '(?:' + | |
'\\w+|' + | |
'"[^"]*"|' + | |
'\'[^\']*\'))?)*)', // 4 - attributes | |
'(/?)', // 5 - is self-closing | |
'>' | |
].join('\\s*') | |
) |
<tag foo="bar">
or<tag required foo="bar">
or</tag>
or<tag src="foo"/>
all match- but
<tag required foo="/bar">
does not because of the slash inside the attribute value
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i want it to allow for
/
in the value of the attribute