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 |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/hx/util/RegValidatorUtil.java b/src/main/java/com/hx/util/RegValidatorUtil.java
index 4c89a09..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;
 	}
 
 	/**
@@ -240,6 +244,20 @@
 	}
 
 	/**
+	 * 鍒ゆ柇瀛楃涓叉槸涓嶆槸double鍨�
+	 * @param str
+	 * @return
+	 */
+	public static boolean isNumeric(String str){
+		Pattern pattern = Pattern.compile("[0-9]+[.]{0,1}[0-9]*[dD]{0,1}");
+		Matcher isNum = pattern.matcher(str);
+		if( !isNum.matches() ){
+			return false;
+		}
+		return true;
+	}
+
+	/**
 	* @param regex
 	* 姝e垯琛ㄨ揪寮忓瓧绗︿覆
 	* @param str

--
Gitblit v1.8.0