I have the following code:
var temp = '<p class="fasfasfasd">Type <strong>Markdown</strong> here. {:.fasfasfasd}</p>'+
'<p class="fdfsdf">fdsfsdf {:.fdfsdf}</p>'
//this should match everything like {:*}
var re = /\{:(.*?)\}/;
console.log(temp);
temp = temp.replace(re, "", 'gm');
console.log(temp);
Here a running example: http://jsfiddle.net/AL8DN/
I want to delete all occurences of the regex re in the string temp. However the second match of the regex is never deleted. What did I wrong?