This commit is contained in:
Looly
2022-09-30 20:18:41 +08:00
parent 83a4f14b43
commit 6f6e1e2fd5
3 changed files with 36 additions and 1 deletions

View File

@@ -204,4 +204,12 @@ public class ReUtilTest {
Assert.assertEquals(map.get("month"), "10");
Assert.assertEquals(map.get("day"), "11");
}
@Test
public void issuesI5TQDRTest(){
final Pattern patternIp = Pattern.compile("((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})\\.((2(5[0-5]|[0-4]\\d))"
+ "|[0-1]?\\d{1,2})\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})");
final String s = ReUtil.replaceAll("1.2.3.4", patternIp, "$1.**.**.$10");
Assert.assertEquals("1.**.**.4", s);
}
}