Replace all attributes in Visual Studio


February 2019


224 time


I have many cs files, with the next annotation:

[Js(, imo = false, tr="csc")]

where the tr value is changed between each cs file.

I want to delete all these annotation automaticlly. So I try to use "replace all" in Visual studion, when I choose regular expressions function. So I wrote:

find what: [Js*]
replace with ''

and It finds many characters in the code, which I don't want to delete.

How can I do it?

2 answers


I think you're are looking for the following regex:


The char [ is a special char in regex, so it has to be escaped.

\[ = [

. = Matches any single character except a line break.

* = Matches zero or more occurrences of the preceding expression, and makes all possible matches.

More information surf to:


Try regular expression.


while find and replace.