I have a changelog file formatted using [Github's markdown](https://help.github.com/articles/github-flavored-markdown/).

Initially I used *inline* links for every link I needed to add, that is:

```
This is some [example](http://www.stackoverflow.com) line of text.

```

Over time, as the file grew in size, it became a bit messy due mainly to this way of inserting links.

I'd like to convert all links from *inline* to *reference* (see [description of each](http://daringfireball.net/projects/markdown/syntax#link)), that is convert the above line to this:

```
This is some [example][1] line of text.

[1]: http://www.stackoverflow.com

```

Since the file is rather large and contains many *inline* links, I was wondering if there is some automated way to do this. I use Sublime Text 3 to edit, but I couldn't find a suitable package for this task. Perhaps some clever regex?