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

菜鳥javascript基礎(chǔ)資料整理3 正則

 更新時(shí)間:2010年12月06日 20:34:01   作者:  
js正則表達(dá)式(RegExp對(duì)象) 的使用。
1.js正則表達(dá)式(RegExp對(duì)象)
RegExp 對(duì)象有 3 個(gè)方法: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ù)。

相關(guān)文章

最新評(píng)論