http://www.360doc.com/content/11/0407/20/2956608_108008354.shtml
<html>
<head>
<title></title>
<script language="javascript">
function replaceAll()
{
var oldValue = "abcdea";
var newValue = oldValue.replace(new RegExp("\a","gm"),"x");
alert("oldValue="+oldValue+"\n"+"newValue="+newValue);
}
replaceAll();
</script>
</head>
<body>
</body>
</html>