修复123解析 #123

This commit is contained in:
q
2025-09-12 17:34:07 +08:00
parent 55e6227de0
commit 5c60493a24
5 changed files with 56 additions and 25 deletions

View File

@@ -29,4 +29,20 @@ public class TestRegex {
System.out.println(matcher.group(1));
}
}
@Test
public void testYeShareKey() {
String url = "ABCD1234-asdasd";
String shareKey = url.replaceAll("(\\..*)|(#.*)", "");
System.out.println(shareKey);
url = "ABCD1234-adasd.html";
shareKey = url.replaceAll("(\\..*)|(#.*)", "");
System.out.println(shareKey);
url = "ABCD1234-adasd#123123";
shareKey = url.replaceAll("(\\..*)|(#.*)", "");
System.out.println(shareKey);
url = "ABCD1234-adasd.html#123123";
shareKey = url.replaceAll("(\\..*)|(#.*)", "");
System.out.println(shareKey);
}
}