From 8e76f087ffa5143aa104054f6c4d9c3f0f88c34b Mon Sep 17 00:00:00 2001 From: hankozhouzhm Date: Fri, 12 Jul 2024 07:51:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20phone.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +1 --- phone.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/phone.py b/phone.py index 30c28af..55b799b 100644 --- a/phone.py +++ b/phone.py @@ -1,7 +1,8 @@ -# 手机号正则 -import re -phone_num = re.compile(r'\d{11}') -print(phone_num.search('我的电话是13512345678')) -print(phone_num.search('我的电话是1351234567')) -print(phone_num.search('我的电话是135123456789')) - +# 手机号正则+1 +import re +phone_num = re.compile(r'\d{11}') +print(phone_num.search('我的电话是13512345678')) +print(phone_num.search('我的电话是1351234567')) +print(phone_num.search('我的电话是135123456789')) + +