diff --git a/index.js b/index.js index 989354d..947d98e 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,8 @@ 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: /^\w{1,}@{1}\w+\.+\w+$/, + url: /^(http|https):\/\/(\w+\.)+\w+([:0-9]{5})?/, + ipv4: /^(((\d{1,2})|(1\d{2})|(2[0-4]\d)|25[0-5])\.){3}((\d{1,2})|(1\d{2})|(2[0-4]\d)|25[0-5])$/, + idcard: /^\d{6}1[8-9]\d{2}(0[1-9]|1[0-2])(\d|[0-2]\d|3[0-1])\d{3}[\dX]$/, +};