diff --git a/index.js b/index.js index 989354d..93a898f 100644 --- a/index.js +++ b/index.js @@ -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: /^.$/, + email: /^(.+)@(.+).$/, + url: /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/, + ipv4: /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/, + 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 diff --git a/package.json b/package.json index 4f114a5..34f6a77 100644 --- a/package.json +++ b/package.json @@ -11,4 +11,4 @@ "devDependencies": { "mocha": "^5.0.0" } -} \ No newline at end of file +}