Open condorheroblog opened 3 months ago
原始正则:
/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/
正则中的第二个定位符(^)是不必要的,可以删除,保留一个即可:
^
/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/
通过 regexp/no-useless-assertions 检查发现
原始正则:
正则中的第二个定位符(
^
)是不必要的,可以删除,保留一个即可: