「JavaScript」正規表現test()、exec()、match()の使い方

1.test()
var str = “1a1b1c";
var reg = new RegExp(“1.", “");
alert(reg.test(str));

2.exec()
var str = “1a1b1c";
var reg = new RegExp(“1.", “");
var arr = reg.exec(str);

3.match()
var str = “1a1b1c";
var reg = new RegExp(“1.", “");
alert(str.match(reg));

JavaScript

Posted by arkgame