From 32c22478ae92df7b430265b5c4c9473760e5dcbb Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Tue, 28 Oct 2025 13:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=82=AE=E6=94=BF=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- regular/index.d.ts | 7 ++++++- regular/index.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/regular/index.d.ts b/regular/index.d.ts index c14003c..cc447be 100644 --- a/regular/index.d.ts +++ b/regular/index.d.ts @@ -46,4 +46,9 @@ export const STRONG_PASSWORD: RegExp; /** * 匹配完整的HTML标签,包括开始标签和结束标签。 */ -export const HTML_TAG: RegExp; \ No newline at end of file +export const HTML_TAG: RegExp; + +/** + * 匹配中国大陆的邮政编码。 + */ +export const POSTAL_CODE: RegExp; diff --git a/regular/index.js b/regular/index.js index 1d7b7bf..b9f0a4f 100644 --- a/regular/index.js +++ b/regular/index.js @@ -54,3 +54,8 @@ export const STRONG_PASSWORD * 匹配完整的HTML标签,包括开始标签和结束标签。 */ export const HTML_TAG = /<[^>]*>/g; + +/** + * 匹配中国大陆的邮政编码。 + */ +export const POSTAL_CODE = /^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/g;