I have been trying to apply the technique offered by ib in another answer on stackoverflow, cannot get it to work in m case.
I am trying to extract a list of numbers from text with reference links in this format
[1]:www.example.com
[2]:www.example.2.com
After extracting the numbers I wish to get the maximum value from the list so that I can find the next appropriate number to use.
It was suggested in a excellent answer here:
How to extract regex matches using Vim
to another person that the following format might work:
:let nextreflink=[] | %s/\d\zs/\=add(nextreflink,submatch(1))[1:0]/g
However, when calling "echo new"
, in my case, the list is empty.
Any ideas would be very welcome!