I got a long array of anonymous function in a javascript file and I want to add a name before the functions. I want to go from that
[function(){...} ,function(){...} ,...,function(){...}]
to that
[function foo_1(){...},function foo_2(){...},...,function foo_850(){...}]
I'm using Visual Studio Code that allow searching and replacing strings using regexp. I got no problem writing the regexp except for the substitution token that would mean this is the Nth match for your search.
Something like $Nth that will return 1 for first occurence of your search in text. Then 2 and so on.
Or even better $Nth(45) that will start at 45 then 46...
Does such a token exist ?