Regular expression regex question

Hey All,

I’m having a tough time trying to understand how to do a regular expression. My string looks something like this:

http://my_url_is_here&&.xml?key=value&key=value&&

so I’m trying to write a regular expression to remove the &&.xml and to remove the && at the end. The URL is dynamically generated, so there may be just one & or there could be 5 so I need to remove all of them This is what i have

my_string = my_string.replace(/(&*.xml)/g, ".xml");

That is good if i just want to remove the && before the xml, but i’m trying to actually remove any instances of the “&” before the .xml and any instances of “&&” at the end of the string.

I searched the documentation (link below) and it got me this far http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7eab.html

Any feedback would be much appreciated.