mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix regex
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.7.16 (2021-11-02)
|
# 5.7.16 (2021-11-04)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【core 】 增加DateTime.toLocalDateTime
|
* 【core 】 增加DateTime.toLocalDateTime
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
* 【poi 】 修复合并单元格为日期时,导出单元格数据为数字问题(issue#1911@Github)
|
* 【poi 】 修复合并单元格为日期时,导出单元格数据为数字问题(issue#1911@Github)
|
||||||
* 【core 】 修复CompilerUtil.getFileManager参数没有使用的问题(issue#I4FIO6@Gitee)
|
* 【core 】 修复CompilerUtil.getFileManager参数没有使用的问题(issue#I4FIO6@Gitee)
|
||||||
* 【core 】 修复NetUtil.isInRange的cidr判断问题(pr#1917@Github)
|
* 【core 】 修复NetUtil.isInRange的cidr判断问题(pr#1917@Github)
|
||||||
|
* 【core 】 修复RegexPool中对URL正则匹配问题(issue#I4GRKD@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ public interface RegexPool {
|
|||||||
/**
|
/**
|
||||||
* Http URL
|
* Http URL
|
||||||
*/
|
*/
|
||||||
String URL_HTTP = "(https://|http://)?([\\w-]+\\.)+[\\w-]+(:\\d+)*(/[\\w- ./?%&=]*)?";
|
String URL_HTTP = "(https://|http://)?([\\w-]+\\.)+[\\w-]+(:\\d+)*(/[\\w- ./?%&=:]*)?";
|
||||||
/**
|
/**
|
||||||
* 中文字、英文字母、数字和下划线
|
* 中文字、英文字母、数字和下划线
|
||||||
*/
|
*/
|
||||||
|
@@ -227,4 +227,10 @@ public class ValidatorTest {
|
|||||||
Validator.validateIpv4("255.255.255.255", "Error ip");
|
Validator.validateIpv4("255.255.255.255", "Error ip");
|
||||||
Validator.validateIpv4("127.0.0.0", "Error ip");
|
Validator.validateIpv4("127.0.0.0", "Error ip");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isUrlTest(){
|
||||||
|
String content = "https://detail.tmall.com/item.htm?id=639428931841&ali_refid=a3_430582_1006:1152464078:N:Sk5vwkMVsn5O6DcnvicELrFucL21A32m:0af8611e23c1d07697e";
|
||||||
|
System.out.println(Validator.isMatchRegex(Validator.URL_HTTP, content));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user