diff --git a/index.js b/index.js index 989354d..24ccde7 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,16 @@ /* * @Author: kael * @Date: 2018-02-14 17:50:28 - * @Last Modified by: kael - * @Last Modified time: 2018-07-10 16:50:09 + * @Last Modified by: zhudui + * @Last Modified time: 2022-09-18 22:30 */ module.exports = { mobile: /^1\d{10}$/, qq: /^[1-9]\d{4,10}$/, number: /^[-+]?(?:\d+(?:\.\d*)|(?:\d*\.)?\d+)$/, - email: /^.$/, - url: /^.$/, - ipv4: /^.$/, - idcard: /^.$/, + email: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, + url: /^https?:\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]$/, + ipv4: /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/, + idcard: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, }; \ No newline at end of file