1.js正則表達(dá)式(RegExp對象) RegExp 對象有 3 個方法:test()、exec() 以及 compile()。 ①test()方法 //test() 方法檢索字符串中的指定值。返回值是 true 或 false。 var patt1=new RegExp("e"); document.write(patt1.test("The best things in life are free")); ②exec()方法 //exec() 方法檢索字符串中的指定值。返回值是被找到的值。如果沒有發(fā)現(xiàn)匹配,則返回 null。 var patt1=new RegExp("e"); document.write(patt1.exec("The best things in life are free")); 未完待續(xù)。