Last active
August 31, 2023 12:42
-
-
Save pseudosavant/0187ea97d5fd87ce78bb to your computer and use it in GitHub Desktop.
Javascript Regular Expression for finding HTML tags in a string
Is there a reason you do
[a-z]
when those would be included in[^>]
?
Ensuring there is a letter right at the start of the opening or closing tag is good; it keeps you from erroneously matching strings like "If 3 < 4 > 2 etc"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pseudosavant Only that I was going to extract the content of the tags letter. Your's is probably the shortest possible.