How can I delete all the comments in a document without having to go one by one eliminating? Could it be done with regular expressions?
How can I delete all the comments in a document without having to go one by one eliminating? Could it be done with regular expressions?
In Atom, as you say you can use regular expressions using. * and then add:
(\/\*[\w\'\s\r\n\*]*\*\/)|(\/\/[\w\s\']*)|(\<![\-\-\s\w\>\/]*\>)
The expression will find all the comments and replace them with nothing.
Another way of not having to erase everything one by one would be to select the comment symbol of the language and go selecting them with Ctrl + D and delete all the selected lines with Ctrl + Shift + K
In Atom press Ctrl + F to open the text search in a file, activate the Regex represented by this icon . * and in Find in current buffer write this:
<!--.+-->
//.+
/\*.+\*/