javascript regex summary
js中正则表达式的几种应用场景:
验证
RegExp.prototype.test
提取
String.prototype.matchString.prototype.matchAllRegExp.prototype.exec
match/exec方法,如果没有分组匹配,则通常取matches[0],如果有分组匹配,则取matches[1]、matches[2]...
替换
String.prototype.replaceString.prototype.replaceAll
拆分
String.prototype.split