Amended Pull Request 

I changed it up to use the more greedy .* and that will match anything inside of reference which is what we want anyway.  

Apologies for making a little mess.  Confirmed it works with FF and Chrome isn't happy with WebKit Nightly