2

how can I escape "[" in Resharper 6s Structural Search (C#). If i am searching for a pattern which contains a square bracket i just got the info: pattern is ambiguous.

Is there any documentation of the syntax? I can't find a syntax documentation on the resharper homepage except for the $VarName$ syntax.

Standard regex escapes like \[ \\[ where tested. They are not working.

Basically I want to do a search and replace.

Bas Leijdekkers
  • 23,709
  • 4
  • 70
  • 68
Daniel Bişar
  • 2,663
  • 7
  • 32
  • 54

1 Answers1

0

Quoting your comment:

something like this: [assembly: AssemblyFileVersion("...")]

Structural Search and Replace looks for executable code, which this isn't. To find what you want (the keybindings I use are the Visual Studio ones):

  • ReSharper | Navigate | Go to Symbol... (or Alt+Shift+T)
  • Type in AssemblyFileVersionAttribute
  • If R# doesn't automatically switch to searching library types, check the Include library types checkbox
  • You should be taken to the definition of this attibute, in the Object Browser
  • ReSharper | Find | Find Usages (or Shift+F12)

You should now be shown all the usages of this attribute, in the R# Find Results window.

AakashM
  • 62,551
  • 17
  • 151
  • 186
  • Sorry the comment above was only an example. I want to do a search and replace of multiple attributes. I just wanted to keep the example simple. – Daniel Bişar Nov 30 '11 at 13:00
  • Visual Studio's Find and Replace has regular expression support and is pretty powerful. Perhaps you can persuade it to do what you want. – AakashM Nov 30 '11 at 13:44
  • Yes i actually did it now with this but it is not as comfortable as Resharpers Search if you want to search multiple lines – Daniel Bişar Nov 30 '11 at 15:38