How can I use javascript regexp to do a case insensitive, global search and replace on a string with the following pattern:
[media id="5"] or [Media id=5]
and replace entirely with:
http://someurl/?somevar=THE_ID_FROM_THE_PATTERN
So basically, something like this:
var mystring = '<img src="[media id=5]" />';
Should be converted to:
var newstring = '<img src="http://someurl/?somevar=5" />';