var text = "testing: 1, 2, 3";
var pattern = /\d+/g;
var execPattern = /(\w+):\s(\d),\s(\d),\s(\d)/g;
pattern.test(text); // true ==> 匹配成功
execPattern.exec(text); // ['testing: 1, 2, 3', 'testing:', '1', ', 2', '3']
text.search(pattern); // 9 ==> 首次匹配成功的位置
text.match(pattern); // ['1', '2', '3'] ==> 所有匹配成功的数组
text.replace(pattern, '#'); // ['testing: #, #, #'] ==> 替换所有匹配到的字符
text.split(/\D+/); // ['', '1', '2', '3'] ==> 用非数字字符截取字符串