I try to write a simple Markdown parser in JavaScript. Therefore I want to check for the [link content][link id] syntax. I use the following code:
[link content][link id]
var r = /\[(.*?)\][ ]*\[([0-9]+)\]/g; data = data.replace( r, '$1' );