First off I don\'t know much about regex and need to buy a book because it\'s has proven to me to be difficult to pickup.
Ultimately I want to take a dom element, an
.replace(/\[([^\]]*)\]/g, link + "$1")
which means, find text between [ and ] and replace it with the value of link, the text itself and ''. This ensures matching square brackets. The 'g' means 'do it multiple times (globally)'.