How to remove all C# methods/properties/fields "summary" comments
(starting with ///
)
in current document in Visual Studio with one shot?
In other words convert this:
/// <summary>
/// Very stupid comment generated with very stupid tool
/// </summary>
protected void MyMethod
{
}
Into this:
protected void MyMethod
{
}
Regex pattern
^.*\/\/\/ ?<summary>.*\n(?:^.*\/\/\/.*$\n)*
will be more suitable in this case because it will match whole summary comment at once.^.*\/\/\/ ?<summary>.*\n
- matches line with/// <summary>
text (with optional space after slashes)(?:)+
- non-capturing group, repeated zero or more times^
- beginning of the line.*
- any characters\/\/\/
- three slashes.*
- any characters$
- end of line\n
- line break symbolHow about
Use
:Regular expressions
Find what
field following expression^.*\/\/\/.*$\n
(shortly - line with///
pattern)Replace with
field emptyLook in
inCurrent Document
Replace All