mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
PhoneUtil.isTel400800支持400-XXX-XXXX格式
This commit is contained in:
parent
7ab37b7433
commit
5fcd4093be
@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.8.13.M1 (2023-02-24)
|
# 5.8.13.M1 (2023-02-28)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
|
* 【core 】 PhoneUtil.isTel400800支持400-XXX-XXXX格式(issue#2929@Github)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【db 】 修复识别JDBC驱动时重复问题(pr#940@Gitee)
|
* 【db 】 修复识别JDBC驱动时重复问题(pr#940@Gitee)
|
||||||
* 【core 】 修复法定年龄计算的BUG(pr#935@Gitee)
|
* 【core 】 修复法定年龄计算的BUG(pr#935@Gitee)
|
||||||
|
@ -85,7 +85,7 @@ public interface RegexPool {
|
|||||||
*
|
*
|
||||||
* @see <a href="https://baike.baidu.com/item/800">800</a>
|
* @see <a href="https://baike.baidu.com/item/800">800</a>
|
||||||
*/
|
*/
|
||||||
String TEL_400_800 = "0\\d{2,3}[\\- ]?[1-9]\\d{6,7}|[48]00[\\- ]?[1-9]\\d{6}";
|
String TEL_400_800 = "0\\d{2,3}[\\- ]?[1-9]\\d{6,7}|[48]00[\\- ]?[1-9]\\d{2}[\\- ]?\\d{4}";
|
||||||
/**
|
/**
|
||||||
* 18位身份证号码
|
* 18位身份证号码
|
||||||
*/
|
*/
|
||||||
|
@ -96,4 +96,13 @@ public class PhoneUtilTest {
|
|||||||
Assert.assertEquals("7654321", PhoneUtil.subTelAfter("0755-7654321"));
|
Assert.assertEquals("7654321", PhoneUtil.subTelAfter("0755-7654321"));
|
||||||
Assert.assertEquals("7654321", PhoneUtil.subTelAfter("07557654321"));
|
Assert.assertEquals("7654321", PhoneUtil.subTelAfter("07557654321"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isTel400800Test() {
|
||||||
|
boolean tel400800 = PhoneUtil.isTel400800("400-860-8608");//800-830-3811
|
||||||
|
Assert.assertTrue(tel400800);
|
||||||
|
|
||||||
|
tel400800 = PhoneUtil.isTel400800("400-8608608");//800-830-3811
|
||||||
|
Assert.assertTrue(tel400800);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user