I have string like this
<html>
[[Wayfinder? &startId=`0` &outerClass=`art-hmenu` ]] &
&
</html>
I want to change all & that inside of [[ and ]] will be replaced by &
How to do that with javascript?
str.replace(/\[\[(.*)?]]/, function(match) {
return match.replace(/&/g, '&');
});
Here's the fiddle: http://jsfiddle.net/Jtv5a/
/\[\[(.*)?\]\]/ to /\[\[(.{4})?\]\]/