Remove comments in code


/ Published in: Regular Expression
Save to your folder(s)

It removes all standard C-style comments(/* 1-n */) and all single line comments("//"). Greedy matching.


Copy this code and paste it in your HTML
  1. (/\*([^*]|[
  2. ]|(\*+([^*/]|[
  3. ])))*\*+/)|(//.*)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.