欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

菜鳥javascript基礎資料整理3 正則

 更新時間:2010年12月06日 20:34:01   作者:  
js正則表達式(RegExp對象) 的使用。
1.js正則表達式(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ù)。

相關文章

最新評論