Reputation: 3789
Is there any chance to remove all comments with the following structure in the whole source-code:
/*
* (non-Javadoc)
* @see this.is.my.package.structure#overridenMethod()
*/
@Override
public void overridenMethod(){}
They were generated by eclipse automatically but it seems like they cannot be removed automatically as well.
What regular-expression would remove all these occurences?
Upvotes: 2
Views: 590
Reputation: 425083
Treat the newlines as just more whitespace:
\s*/\*\s*\* \(non-Javadoc\)\s*\* @see \S+\s*\*/
See demo
Upvotes: 3
Reputation: 72864
Try this:
(?s)/\*[^\*].+?\*/
(?s)
at the beginning is a flag to enable multiline matching.
[^\*]
is used to skip catching two consecutive *
which correspond to Javadoc-style comments.
Upvotes: 1