regular expression shortened

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1260 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 19 years ago
parent 51433a121f
commit 106cd29981

@ -163,9 +163,9 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen
String path = url.getFile(); String path = url.getFile();
// (this is different from previous normal forms where a '/' must not appear in root paths; here it must appear. Makes everything easier.) // (this is different from previous normal forms where a '/' must not appear in root paths; here it must appear. Makes everything easier.)
if ((path.length() == 0) || (path.charAt(0) != '/')) path = "/" + path; if (path.length() == 0 || path.charAt(0) != '/') path = "/" + path;
Pattern pathPattern = Pattern.compile("(/[^/\\.]+/)(?<!/[.]{2}/)[.]{2}(?=/)|/\\.(?=/)|/(?=/)"); Pattern pathPattern = Pattern.compile("(/[^/\\.]+/)[.]{2}(?=/)|/\\.(?=/)|/(?=/)");
Matcher matcher = pathPattern.matcher(path); Matcher matcher = pathPattern.matcher(path);
while (matcher.find()) { while (matcher.find()) {
path = matcher.replaceAll(""); path = matcher.replaceAll("");

Loading…
Cancel
Save