From ed763729c04e7acab6de16d70e119ee365869bea Mon Sep 17 00:00:00 2001 From: luohuidong Date: Mon, 19 Sep 2022 01:12:33 +0800 Subject: [PATCH] completed homework7 --- index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 989354d..9c03f9f 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ /* - * @Author: kael - * @Date: 2018-02-14 17:50:28 + * @Author: kael + * @Date: 2018-02-14 17:50:28 * @Last Modified by: kael * @Last Modified time: 2018-07-10 16:50:09 */ @@ -9,8 +9,9 @@ module.exports = { mobile: /^1\d{10}$/, qq: /^[1-9]\d{4,10}$/, number: /^[-+]?(?:\d+(?:\.\d*)|(?:\d*\.)?\d+)$/, - email: /^.$/, - url: /^.$/, - ipv4: /^.$/, - idcard: /^.$/, -}; \ No newline at end of file + email: /^[a-zA-Z0-9]\w*@[\w-]+(\.[\w-]+)+$/, + url: /^(http(s)?:\/\/)?[\w-]+(\.[\w-]+)+$/, + ipv4: /^((\d{0,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{0,2}|1\d{2}|2[0-4]\d|25[0-5])$/, + idcard: + /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2,3}[0-9Xx]$/, +};