Posted By

XtreamIT on 02/02/13


Tagged

regex remove comments greedy


Versions (?)

Remove comments in code


 / Published in: Regular Expression
 

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

  1. (/\*([^*]|[
  2. ]|(\*+([^*/]|[
  3. ])))*\*+/)|(//.*)

Report this snippet  

You need to login to post a comment.