I need to make html pages where I want to share Ad space with other adsense users. I am trying to use javascript to find and replace adsense code using regex expression but I am stuck.
This is the piece of string I am trying to match.
pub-111111111111111";
/* 336x280, created 12/12/12 */
google_ad_slot = "2222222222";
And this is the javascript containing regex expression that I tried (out of many other combination).
<script type="text/javascript">
var html = document.body.innerHTML;
html = html.replace(/pub-([\d])*(";)\r(.)*\r(.)*([\d])(";)/i,'pub-444444444444444";google_ad_slot = "3333333333333";');
document.body.innerHTML = html;
</script>
But no luck. Anything RegEx other than pub-([\d])* part is not getting evaluated as I see using firebug.