正则规则中有“|”时,会引起解析错误:
'regex:d{3,4}[s,-]?d{7,8}|1[3,4,5,8]d[s,-]?d{4}[s,-]?d{4}'
使用数组语法可以解决:
['regex' => 'd{3,4}[s,-]?d{7,8}|1[3,4,5,8]d[s,-]?d{4}[s,-]?d{4}']