- 加入360亿方云直链解析

- 优化代码
This commit is contained in:
QAIU
2023-06-10 13:29:22 +08:00
parent 635c639bf5
commit 3f4f9fa76b
7 changed files with 274 additions and 65 deletions

View File

@@ -0,0 +1,24 @@
package cn.qaiu.web.test;
import org.junit.Test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TestRegex {
@Test
public void regexYFC() {
String html = """
<input type="hidden" id="typed_id" value="file_559003251828">
<input type="hidden" id="share_link_token" value="9cbe4b73521ba4d65a8cd38a8c">
""";
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
Matcher matcher = compile.matcher(html);
if (matcher.find()) {
System.out.println(matcher.group(0));
System.out.println(matcher.group(1));
}
}
}