# HG changeset patch # User Tom Gottfried # Date 1372150628 -7200 # Node ID 61e55f36e76494132cac2381a22d08d9b2e5df5d # Parent df867072d003f23bf709c93a5980d51de78f8ce6 Flow Velocity Parser: fixed regular expression for guessing main values diff -r df867072d003 -r 61e55f36e764 backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Mon Jun 24 15:24:07 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Tue Jun 25 10:57:08 2013 +0200 @@ -34,25 +34,25 @@ Logger.getLogger(FlowVelocityModelParser.class); private static final Pattern META_REGEX = - Pattern.compile(".*Rechnung (.*) \\(Pegel (.*)\\).*"); + Pattern.compile(".*Rechnung [unter ]*(.*) \\(Pegel (.*)\\).*"); private static final Pattern META_GAUGE = Pattern.compile("(.*) Q=(\\w*)m3/s"); private static final Pattern META_MAINVALUE_A = - Pattern.compile("([a-zA-Z]+)+(\\d+)*"); + Pattern.compile("([a-zA-Z]+)+(\\d+)*\\S*"); private static final Pattern META_MAINVALUE_B = - Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*.*)"); + Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*\\S*)"); private static final Pattern META_MAINVALUE_C = - Pattern.compile("([0-9]++)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*)"); + Pattern.compile("([0-9]++)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*)"); private static final Pattern META_MAINVALUE_D = - Pattern.compile("(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*bis (([0-9]*)\\s?([a-zA-Z_0-9()]*)|([0-9]++,[0-9]++)\\s?(.*))"); + Pattern.compile("(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*bis (([0-9]*)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*))"); private static final Pattern META_MAINVALUE_E = - Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*.*)"); + Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*\\S*)"); private static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE);