I am working on a Legacy Code, where I am having statements like:
int array[MAX_SIZE_FOR_THIS_ARRAY];
In VIM, I want to replace the Text between [ & ] (including [ & ]) with ARRAY as follows:
int array_ARRAY_;
Please NOTE: 1. The Array Size Macro will be different for Different Arrays, hence we cannot use MAX_SIZE_FOR_THIS_ARRAY in our search pattern. 2. The name of variable "array" is also not fixed.
I need to search for [ ] only & replace [...] with ARRAY everywhere, in thousands of lines of code.
Can somebody please help me with this?