Created
August 12, 2009 15:52
-
-
Save dieseltravis/166584 to your computer and use it in GitHub Desktop.
RegEx to match nested list items pasted from Word in IE6, IE7, and Firefox
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
| var nestedListFixer = /(?:<\/li>(?:<\/ol>\s*)+)+(?:<p(?:\sstyle=\"[^\"]+\")?>(?:\s*<span(?:\sstyle=\"[^\"]+\")?>)*(?:(?:&(?:nbsp|\#0*160|x0*A0);)|\s)+(?:<\/span>)*(?:[ivxlcdm]+\.)(?:\s*<span(?:\sstyle=\"[^\"]+\")?>)*(?:(?:&(?:nbsp|\#0*160|x0*A0);)|\s)+(?:<\/span>)*(.*?)(?:<\/span>)*<\/p>\s*)+(?:<ol(?:\sstyle=\"[^\"]+\")?(?:\stype=\"?\w+\"?)?\sstart=\"?\d+\"?>\s*)+/gi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment