fix regex

This commit is contained in:
Looly
2021-11-04 00:56:23 +08:00
parent a97d8c5b4d
commit d75ddf8e2c
3 changed files with 9 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.7.16 (2021-11-02)
# 5.7.16 (2021-11-04)
### 🐣新特性
* 【core 】 增加DateTime.toLocalDateTime
@@ -30,6 +30,7 @@
* 【poi 】 修复合并单元格为日期时导出单元格数据为数字问题issue#1911@Github
* 【core 】 修复CompilerUtil.getFileManager参数没有使用的问题issue#I4FIO6@Gitee
* 【core 】 修复NetUtil.isInRange的cidr判断问题pr#1917@Github
* 【core 】 修复RegexPool中对URL正则匹配问题issue#I4GRKD@Gitee
-------------------------------------------------------------------------------------------------------------

View File

@@ -107,7 +107,7 @@ public interface RegexPool {
/**
* Http URL
*/
String URL_HTTP = "(https://|http://)?([\\w-]+\\.)+[\\w-]+(:\\d+)*(/[\\w- ./?%&=]*)?";
String URL_HTTP = "(https://|http://)?([\\w-]+\\.)+[\\w-]+(:\\d+)*(/[\\w- ./?%&=:]*)?";
/**
* 中文字、英文字母、数字和下划线
*/

View File

@@ -227,4 +227,10 @@ public class ValidatorTest {
Validator.validateIpv4("255.255.255.255", "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));
}
}