reworked patterns

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@148 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-09-07 23:23:30 +00:00
parent 75df8f3678
commit 254752c705

View file

@ -318,20 +318,20 @@ public class RmvProvider implements NetworkProvider
+ "(?:Ankunft: \\d{2}\\.\\d{2}\\.\\d{2}<br />\n)?" //
+ "Dauer: (\\d{1,2}:\\d{2})<br />.*?" // duration
, Pattern.DOTALL);
private static final Pattern P_CONNECTION_DETAILS_COARSE = Pattern.compile("/b> -\n?(.*?- <b>.*?)<", Pattern.DOTALL);
private static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile("<br />\n?" //
+ "(?:(.*?) nach (.*?)\n?" // line, destination
+ "<br />\n?" //
+ "ab (\\d+:\\d+)\n?" // departureTime
+ "(.*?)\\s*\n?" // departurePosition
+ "<br />\n?" //
+ "an (\\d+:\\d+)\n?" // arrivalTime
+ "(.*?)\\s*\n?" // arrivalPosition
+ "<br />\n?|" //
+ "<a href=\".*?\">\n?" //
+ "Fussweg\\s*\n?" //
+ "</a>\n?" //
+ "(\\d+) Min.<br />\n?)" // footway
private static final Pattern P_CONNECTION_DETAILS_COARSE = Pattern.compile("/b> -\n(.*?- <b>[^<]*)<", Pattern.DOTALL);
private static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile("<br />\n" //
+ "(?:(.*?) nach (.*?)\n" // line, destination
+ "<br />\n" //
+ "ab (\\d{1,2}:\\d{2})\n" // departureTime
+ "(?:(.*?)\\s*\n)?" // departurePosition
+ "<br />\n" //
+ "an (\\d{1,2}:\\d{2})\n" // arrivalTime
+ "(?:(.*?)\\s*\n)?" // arrivalPosition
+ "<br />\n|" //
+ "<a href=[^>]*>\n" //
+ "Fussweg\\s*\n" //
+ "</a>\n" //
+ "(\\d+) Min.<br />\n)" // footway
+ "- <b>(.*?)" // arrival
, Pattern.DOTALL);