prepare 5.8.31

This commit is contained in:
Looly
2024-08-09 19:21:32 +08:00
parent b427440274
commit ef90358c51
29 changed files with 51 additions and 33 deletions

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.30</version>
<version>5.8.31</version>
</parent>
<artifactId>hutool-core</artifactId>

View File

@@ -3,7 +3,6 @@ package cn.hutool.core.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.lang.PatternPool;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
@@ -11,6 +10,8 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import static org.junit.jupiter.api.Assertions.*;
public class ReUtilTest {
final String content = "ZZZaaabbbccc中文1234";
@@ -228,4 +229,19 @@ public class ReUtilTest {
boolean match = ReUtil.isMatch(regex, content);
assertTrue(match);
}
@Test
void getEmailAddressTest() {
String mail = "姓名<a.b@Hutool.cn>";
String s = ReUtil.get(PatternPool.EMAIL, mail, 0);
assertEquals("a.b@Hutool.cn", s);
mail = "姓名 <a.b@Hutool.cn>";
s = ReUtil.get(PatternPool.EMAIL, mail, 0);
assertEquals("a.b@Hutool.cn", s);
mail = "a.b@Hutool.cn";
s = ReUtil.get(PatternPool.EMAIL, mail, 0);
assertEquals("a.b@Hutool.cn", s);
}
}