We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/ + /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}([\dXx])$)/
用字符组代替多选结构,可以提升性能
The text was updated successfully, but these errors were encountered:
好的十分感谢, 稍后修改, 要不要提个pr参与下?
Sorry, something went wrong.
事实上我发现 eslint-plugin-unicorn 可以优化正则,这个issues也来自于此,我在考虑要不要提个统一的PR 将它集成进项目。
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/HEAD/docs/rules/regex-shorthand.md
不过它的优化不是绝对可靠的,需要人工审核
我有项目里有测试脚本, 可以简答测试一下, 提交后action会执行test https://github.com/any86/any-rule/blob/master/__test__/rule.js
pref: 优化"二代身份证号"的正则性能(#55)
ea6baa1
No branches or pull requests
用字符组代替多选结构,可以提升性能
The text was updated successfully, but these errors were encountered: