diff options
author | SammysHP <sven@sammyshp.de> | 2011-09-17 10:41:43 +0200 |
---|---|---|
committer | SammysHP <sven@sammyshp.de> | 2011-09-17 10:41:43 +0200 |
commit | 644b03a25f7b2151fa7bc08fa4601e5babd5c856 (patch) | |
tree | 7aae6b52260ba8098ca89bb157c7b964395c30c7 /main/src/cgeo/geocaching/geopoint/DistanceParser.java | |
parent | b8b32c60cff93d92ac0f8e12a89e22eff830e4f4 (diff) | |
download | cgeo-644b03a25f7b2151fa7bc08fa4601e5babd5c856.zip cgeo-644b03a25f7b2151fa7bc08fa4601e5babd5c856.tar.gz cgeo-644b03a25f7b2151fa7bc08fa4601e5babd5c856.tar.bz2 |
Only - ^ ] \ must be escaped in a character class
See http://www.regular-expressions.info/charclass.html for reference.
Diffstat (limited to 'main/src/cgeo/geocaching/geopoint/DistanceParser.java')
-rw-r--r-- | main/src/cgeo/geocaching/geopoint/DistanceParser.java | 2 |
1 files changed, 1 insertions, 1 deletions
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 |