From 55334da20cff4dac840c320eda1d0ca53ba27eda Mon Sep 17 00:00:00 2001
From: fwq <582742538@qq.com>
Date: 星期一, 23 九月 2024 14:26:36 +0800
Subject: [PATCH] Merge branch 'master-stander' into master-xlk

---
 src/main/java/com/hx/util/RegValidatorUtil.java |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/hx/util/RegValidatorUtil.java b/src/main/java/com/hx/util/RegValidatorUtil.java
index d3d68a2..f74fb0b 100644
--- a/src/main/java/com/hx/util/RegValidatorUtil.java
+++ b/src/main/java/com/hx/util/RegValidatorUtil.java
@@ -9,7 +9,10 @@
  *
  */
 public class RegValidatorUtil {
-	
+
+	/**鎵嬫満鍙锋鍒欏垵濮嬪寲*/
+	public static Pattern pattern = Pattern.compile("^1[3-9]\\d{9}$");
+
 	/**
 	* 楠岃瘉閭
 	* 
@@ -88,15 +91,16 @@
 		return match(regex, str);
 	}
 
-	/**
-	* 楠岃瘉杈撳叆鎵嬫満鍙风爜
-	* 
-	* @param str 寰呴獙璇佺殑瀛楃锟�?
-	* @return 濡傛灉鏄鍚堟牸寮忕殑瀛楃锟�?,杩斿洖 <b>true </b>,鍚﹀垯锟�? <b>false </b>
-	*/
-	public static boolean IsHandset(String str) {
-		String regex = "^[1]+[3,5]+\\d{9}$";
-		return match(regex, str);
+	/**鏍¢獙鎵嬫満鍙风爜
+	 * @param phoneNumber 鎵嬫満鍙�
+	 * @return 鏍¢獙缁撴灉
+	 */
+	public static boolean IsHandset(String phoneNumber) {
+		if ((phoneNumber != null) && (!phoneNumber.isEmpty())) {
+			Matcher m = pattern.matcher(phoneNumber);
+			return m.matches();
+		}
+		return false;
 	}
 
 	/**

--
Gitblit v1.8.0