Looks like some very untested code, yes. I can't seem to get it working whatsoever, it's crashing my Messenger every time I try to run this (infinite loop?):
code:
var StringObj = "Some shit with A's.";
while(RegExp(".*A+[^A]+A*$","gi").exec(StringObj)){
StringObj = StringObj.replace(/(.*?)(A*)(.*)/i,"$1$3$2");
}
Could you try to find some time to get it working in some way?