From 672a16ad19e5ddb4d34239414d948aaaf9287abe Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Thu, 29 Jun 2023 01:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20RegexUtil=20=E5=81=9A?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E6=A0=A1=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhouxy/plusone/commons/domain/ValidatableStringRecord.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/zhouxy/plusone/commons/domain/ValidatableStringRecord.java b/src/main/java/xyz/zhouxy/plusone/commons/domain/ValidatableStringRecord.java index 6b66a6f..df041c4 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/domain/ValidatableStringRecord.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/domain/ValidatableStringRecord.java @@ -21,6 +21,7 @@ import java.util.regex.Pattern; import com.fasterxml.jackson.annotation.JsonValue; import xyz.zhouxy.plusone.commons.util.Assert; +import xyz.zhouxy.plusone.commons.util.RegexUtil; /** * 带校验的字符串值对象 @@ -34,7 +35,7 @@ public abstract class ValidatableStringRecord { protected ValidatableStringRecord(String value, Pattern pattern) { Assert.notNull(pattern, "The pattern must not be null."); Assert.isNotBlank(value, "The value must be has text."); - Assert.isTrue(pattern.matcher(value).matches()); + Assert.isTrue(RegexUtil.matches(value, pattern)); this.value = value; }