Created
June 10, 2023 11:04
-
-
Save thisbit/9f43c0c2bbfbf03966183d79a1967709 to your computer and use it in GitHub Desktop.
Regular Expression written with the use of ChatGPT to clean up html
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
<style\b[^<]*>[\s\S]*?<\/style\b[^<]*>|<((?!(?:a|h[1-6]|p|strong|em|img|span)\b)\w+[^>]*)>|<\/?(?:div|section|link|span)\b[^>]*>|class\s*=\s*"[^"]*"|id\s*=\s*"[^"]*"|style\s*=\s*"[^"]*"|data-[^=]+="[^"]*"|\s+$|\t| |<\w+\b[^>]*><\/\w+\b[^>]*>|<\w+\b[^>]*><\/\w+\b[^>]*>\s*|<\/span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the prompt I crafted durring a convo with ChatGPT
write a regular expression that would do all the following steps in one expression, in the order I list them: