Development JavaScript DHTML



Regular Expression Switch



var rgExp = /(\w*)-*(\w*)/
var str = "AAAA--BBBB";
var resultStrng = str.replace(rgExp,"$2-$1");
document.writeln(resultStrng);