每天一篇javascript学习小结(RegExp对象)_javascript技巧【点击查看详情】
每天一篇javascript学习小结(RegExp对象)_javascript技巧:1、正则表达式test方法 var text = cat, bat, sat, fat; var pattern = /.at/; if (pattern.test(text)){ alert(The pattern was matched.); } 2、正则的toString()方法 var pattern = new Re