正则函数用法

正则函数match、exec、test、search、replace、split

1、test用法:

检查字符串是否与给定的正则表达式相匹配;

如:

if(/(.*)A(.*)/.test('ABC')){
    alert('匹配')
}else{
    alert('不匹配')
}
原文地址:https://www.cnblogs.com/kk073000/p/2937108.html