0

How can I find all my array usages that have an explicit integer as index?

Example:

const int CON = 42;
int[] arr = new int[100];
arr[34] = 12;
arr[CON] = 13;

// need to find: [100], [34]
// not         : [], [CON]


This seems to work with C# Regex and Replace but not in VS 2010 search:
\[\d+\]

(I'm sure I formulated the title awkwardly or something. Sorry.)

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
Bitterblue
  • 13,162
  • 17
  • 86
  • 124

1 Answers1

2

There is a table of regex patterns used in Visual Studio on http://msdn.microsoft.com/en-us/library/2k3te2cs.aspx. In VS2010 and before, you use :d to match digits:

\[:d+\]
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005