Test.java 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package com.zhiqiyun;
  2. import com.alibaba.fastjson.JSON;
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5. import java.util.List;
  6. import java.util.UUID;
  7. import java.util.regex.Pattern;
  8. public class Test {
  9. public static void main(String[] args) throws Exception {
  10. // List<String> listUrls = Arrays.asList("https://www.188420.com/", "https://www.188420.com/c/jdwx/", "https://www.188420.com/c/bgwx/", "https://www.188420.com/a/220124002203.html", "https://www.188420.com/a/211229000364.html", "https://www.188420.com/a/211229000358.html");
  11. // listUrls = new ArrayList<>(listUrls);
  12. //
  13. // List<String> listPatterns = Arrays.asList("https://www.188420.com/a/([0-9]+).html", "https://www.188420.com/b/([a-zA-Z]+)/");
  14. //
  15. // listUrls.removeIf(s -> {
  16. // boolean hasMatched = false;
  17. // for (String regex : listPatterns) {
  18. // hasMatched = Pattern.matches(regex, s);
  19. // if (hasMatched) {
  20. // break;
  21. // }
  22. // }
  23. // return !hasMatched;
  24. // });
  25. System.out.println(UUID.randomUUID().toString());
  26. }
  27. }