What the hell is wrong with this?? For the life in me I can't figure it out.
link = item.getChild("link", atom).getAttribute("href").getValue().replaceText("(https:\/\/www\.google\.com\/url\?rct=j&sa=t&url=|&ct=ga.*)","");
I've tried all sorts of permutations. 'item' is a child in an xml from an atom file:
item = items[i];
This, for instance, works:
link = item.getChild("link", atom).getAttribute("href").getValue().replace("https://www.google.com/url?rct=j&sa=t&url=","");
The goal here, as it might've become apparent, is to get rid of Google's crapware around the results it yields in an alerts feed. I also tried:
link = item.getChild("link", atom).getAttribute("href").getValue().replace("https://www.google.com/url?rct=j&sa=t&url=","").replaceText("&ct=ga.*","");
No avail. And also:
link = item.getChild("link", atom).getAttribute("href").getValue().replace("https://www.google.com/url?rct=j&sa=t&url=","");
link = link.replaceText("&ct=ga.*","");
Nope, not that either. What gives? To make matters worse, some caching is going on and doesn't really help testing the script. That, btw, is here.