I have an org-mode file with more than 12000 footnotes (maybe less), I was cleaning it and found that after the conversion some footnotes weren't converted to org-mode footnotes, so I had to manually make them footnotes.
The thing is, since that addition the reference number inside the square brackets must be re-done otherwise I will end with repeated numbers, like:
 ...  or
 ... . Is there a way to build a regexp that look for all numbers inside square brackets and replace the text inside them with their respective coincidence number (?) for instance:
 is the coincidence number 10 and this other
 is coincidence number 11 so
 ...  becomes
 ... ?
especial petition: if you are going to post an elisp snippet that solves this problem, please, please, please, comment it on detail because I want to learn elisp too!