Skip to content

Instantly share code, notes, and snippets.

@kousherAlam
Created August 24, 2017 04:49
Show Gist options
  • Save kousherAlam/ddedb5fec8dabc4bd2413c95f6fa26d3 to your computer and use it in GitHub Desktop.
Save kousherAlam/ddedb5fec8dabc4bd2413c95f6fa26d3 to your computer and use it in GitHub Desktop.
var COMMENT_PSEUDO_COMMENT_OR_LT_BANG = new RegExp(
'<!--[\\s\\S]*?(?:-->)?'
+ '<!---+>?' // A comment with no body
+ '|<!(?![dD][oO][cC][tT][yY][pP][eE]|\\[CDATA\\[)[^>]*>?'
+ '|<[?][^>]*>?', // A pseudo-comment
'g');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment