mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
prepare 5.8.31
This commit is contained in:
@@ -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>
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user