From 7e8336920541a5fd7927100716107a536bd22494 Mon Sep 17 00:00:00 2001 From: Looly Date: Tue, 3 Sep 2024 18:04:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DRegexPool.CHINESE=5FNAME?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=A4=AA=E5=A4=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++-- .../src/main/java/cn/hutool/core/lang/RegexPool.java | 2 +- .../java/cn/hutool/core/lang/IssueIAOGDRTest.java | 11 +++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 hutool-core/src/test/java/cn/hutool/core/lang/IssueIAOGDRTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d002708..9c5c2f0ba 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,14 @@ # 🚀Changelog ------------------------------------------------------------------------------------------------------------- -# 5.8.33(2024-09-02) +# 5.8.33(2024-09-03) ### 🐣新特性 * 【core 】 SyncFinisher增加setExecutorService方法(issue#IANKQ1@Gitee) ### 🐞Bug修复 -* 【json 】 修复JSONConfig.setDateFormat设置后toBean无效问题(issue#3713@Gitee) +* 【json 】 修复JSONConfig.setDateFormat设置后toBean无效问题(issue#3713@Github) +* 【core 】 修复RegexPool.CHINESE_NAME范围太大的问题(issue#IAOGDR@Gitee) ------------------------------------------------------------------------------------------------------------- **# 5.8.32(2024-08-30) diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/RegexPool.java b/hutool-core/src/main/java/cn/hutool/core/lang/RegexPool.java index 0b7c8291a..e5ab9c3d0 100755 --- a/hutool-core/src/main/java/cn/hutool/core/lang/RegexPool.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/RegexPool.java @@ -221,5 +221,5 @@ public interface RegexPool { * 总结中文姓名:2-60位,只能是中文和维吾尔族的点· * 放宽汉字范围:如生僻姓名 刘欣䶮yǎn */ - String CHINESE_NAME = "^[\u2E80-\u9FFF·]{2,60}$"; + String CHINESE_NAME = "^[\u4E00-\u9FFF·]{2,60}$"; } diff --git a/hutool-core/src/test/java/cn/hutool/core/lang/IssueIAOGDRTest.java b/hutool-core/src/test/java/cn/hutool/core/lang/IssueIAOGDRTest.java new file mode 100644 index 000000000..5e4cec8ae --- /dev/null +++ b/hutool-core/src/test/java/cn/hutool/core/lang/IssueIAOGDRTest.java @@ -0,0 +1,11 @@ +package cn.hutool.core.lang; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class IssueIAOGDRTest { + @Test + void isChineseNameTest() { + Assertions.assertFalse(Validator.isChineseName("张三。")); + } +}