Created
March 6, 2011 02:25
-
-
Save fwextensions/856966 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
/* | |
The regular expression below is used in John Resig's HTML parser written in JS, which | |
I was trying to use in an Adobe Fireworks extension to construct tables from HTML | |
source. In a browser, from IE6 on up, it produces: | |
[<table border="1">,table, border="1",""] | |
In Fireworks' JS parser, derived from Mozilla code released in *1998*, it produces: | |
null | |
Thanks, Adobe! | |
*/ | |
alert('<table border="1">'.match(/^<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment