正则表达式的使用
var country = new RegExp("England");
OR
var country = /England/;
//Example:
var country = new RegExp("England");
var geographicLocation = "New England";
document.write("Destination for work: "+geographicLocation+"<<br />>");
geographicLocation = geographicLocation.replace(country, "Zealand");
document.write("Destination for vacation: "+geographicLocation);