mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-01-13 09:54:12 +00:00
- 加入360亿方云直链解析
- 优化代码
This commit is contained in:
24
web-service/src/test/java/cn/qaiu/web/test/TestRegex.java
Normal file
24
web-service/src/test/java/cn/qaiu/web/test/TestRegex.java
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user