Regex to capture comments

/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg
https://regexr.com/3hutg
/*This one comment*/
//This is also comment
/* comment with some space */
Some code//comment in the end
//comment1
//comment2
/**
/*Multi line
/*Another
*/
/*
Another style of comment
*/

Comments

Popular posts from this blog