I have a piece of code which indexes a 1D as a 2D array like this:
#define N 10
#define INDEX(i, j) (i + j*N)
array[INDEX(2, 1)]
now having changed array to be a 2D array, I would like to replace all instances of this in a file with
array[2][1]
regardless of what the characters used to index the array are. Could somebody who is familiar with Regex or some other way of pattern matching something like this help me?