ץʤɤǥƥȸɽ(Regular Expression)˴ؤ
matchåɤǡʸɽΥѥ˹פʸФ롣 ФʸϡString֥ȤǤϤʤ
ʲϡƥХ륹å̵ξ硣
var test = "abcd_efg 123 xyz"; var res = test.match( /^\w+/ ); if (res != null) { alert(res); //ޥåʸ alert(res.length); //ʸΥޥåĿ(Х륹å̵1) alert(res[0].length); //ޥåʸĹ alert(test.substr(res[0].length)); //(ǽ˥ޥåʬλĤ) }