Created
November 7, 2016 11:22
-
-
Save MikelArnaiz/531d4a31780aad9c0c548ccb033092a3 to your computer and use it in GitHub Desktop.
Javascript regex to remove HTML comments
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
( |\t)*?<!--(.|\s)*?-->( |\t)*/gm | |
https://regex101.com/r/OraWn4/4 | |
<!-- comment with whitespaces before tag --> <div> | |
<div> <!-- comment with whitespaces after tag -->aa | |
<!-- comment with whitespaces on a line --> | |
<!-- | |
this is a block comment | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment