(String str)
| 104 | |
| 105 | // js路径匹配 |
| 106 | public static String Path(String str){ |
| 107 | ArrayList<String> path = new ArrayList<>(); |
| 108 | String path1 = new String(); |
| 109 | // String is_path = "[\"|'](?:(\\.)*/|/)[0-9a-zA-Z.]+(?:((/[\\w,\\?,-,_,.]*)+)|[\"|'])"; |
| 110 | String is_path = "[\"|'](/[0-9a-zA-Z.]+(?:/[\\w,\\?,-,\\.,_]*?)+)[\"|']"; |
| 111 | Matcher matcher = Pattern.compile(is_path).matcher(str); |
| 112 | while (matcher.find()){ |
| 113 | path.add(matcher.group()); |
| 114 | } |
| 115 | // 去重代码 |
| 116 | List<String> path_rd = Re.removeDuplicate(path); |
| 117 | for (String s : path_rd){ |
| 118 | path1 += StringUtils.strip(s,"\"'")+'\n'; |
| 119 | } |
| 120 | // return StringUtils.strip(path1,"[]"); |
| 121 | return path1; |
| 122 | } |
| 123 | public static String Url(String str){ |
| 124 | ArrayList<String> url = new ArrayList<>(); |
| 125 | String url1 = new String(); |
no test coverage detected