From 644b03a25f7b2151fa7bc08fa4601e5babd5c856 Mon Sep 17 00:00:00 2001 From: SammysHP Date: Sat, 17 Sep 2011 10:41:43 +0200 Subject: Only - ^ ] \ must be escaped in a character class See http://www.regular-expressions.info/charclass.html for reference. --- main/src/cgeo/geocaching/geopoint/DistanceParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/src/cgeo/geocaching/geopoint/DistanceParser.java') diff --git a/main/src/cgeo/geocaching/geopoint/DistanceParser.java b/main/src/cgeo/geocaching/geopoint/DistanceParser.java index e5fbd62..01264c4 100644 --- a/main/src/cgeo/geocaching/geopoint/DistanceParser.java +++ b/main/src/cgeo/geocaching/geopoint/DistanceParser.java @@ -8,7 +8,7 @@ import java.util.regex.Pattern; public final class DistanceParser { - private static final Pattern pattern = Pattern.compile("^([0-9\\.,]+)[ ]*(m|km|ft|yd|mi|)?$", Pattern.CASE_INSENSITIVE); + private static final Pattern pattern = Pattern.compile("^([0-9.,]+)[ ]*(m|km|ft|yd|mi|)?$", Pattern.CASE_INSENSITIVE); /** * Parse a distance string composed by a number and an optional suffix -- cgit v1.1