Is there a regex for comments that look like this:
/**
* -string- (possible line)
-possibly more lines like the above one-
*/
For example:
/**
* The Boring class implements this and that
* and also...
* does this and that
*/
Is there a regex for comments that look like this:
/**
* -string- (possible line)
-possibly more lines like the above one-
*/
For example:
/**
* The Boring class implements this and that
* and also...
* does this and that
*/
A simple /\*\*.*?\*/ with a dotall (dot matches all) flag should do the trick. Although it may require different escaping or possible delimiters depending on which flavour of regex engine you're using.
If you don't have dotall in your engine try something like:
/\*\*[\s\S]*?\*/
\/\*\*^(\*\/)*?\*\/, also you're missing an escape before the last slash./. That's only necessary if / is picked as a delimiter and the engine requires delimiters, otherwise / has no special meaning. Since the question didn't specify I had to make some assumptions in my answer :)[\s\S] means any character that is either whitespace or not whitespace (which is a long-winded way of saying any character).