summaryrefslogtreecommitdiff
path: root/core/java/android/util/Patterns.java
diff options
context:
space:
mode:
authorBin Zhu <bin.zhu@sonyericsson.com>2012-09-19 15:00:49 +0200
committerJohan Redestig <johan.redestig@sonymobile.com>2013-02-15 11:54:41 +0100
commita37fc575a4ac40f3ff2e9a9f2108b577a649db73 (patch)
tree9eb9804a12a16f772b3542f180d1c104f4a8b577 /core/java/android/util/Patterns.java
parentc5748148c56e129e7b5cec7fac0921ce7967d054 (diff)
Allow three digit phone numbers
The comment for the PHONE pattern says: "<digit><digit|sdd>+<digit>" But the actual pattern requires that the string contains more than that. A phone number should be allowed to be three digits. Change-Id: I86d2f3d634cd0c1654dad9814906f151055dc23a
Diffstat (limited to 'core/java/android/util/Patterns.java')
-rw-r--r--core/java/android/util/Patterns.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java
index 152827d209d2..952211245bb0 100644
--- a/core/java/android/util/Patterns.java
+++ b/core/java/android/util/Patterns.java
@@ -169,10 +169,10 @@ public class Patterns {
* </ul>
*/
public static final Pattern PHONE
- = Pattern.compile( // sdd = space, dot, or dash
- "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>*
- + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>*
- + "([0-9][0-9\\- \\.][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>
+ = Pattern.compile( // sdd = space, dot, or dash
+ "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>*
+ + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>*
+ + "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>
/**
* Convenience method to take all of the non-null matching groups in a