am b5a1ce2f: Merge "Allow three digit phone numbers"
* commit 'b5a1ce2f5daa20b5c77113b8887e12dcc05590fc': Allow three digit phone numbers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -156,6 +156,8 @@ public class PatternsTest extends TestCase {
|
||||
"Me: 16505551212 this\n",
|
||||
"Me: 6505551212 this\n",
|
||||
"Me: 5551212 this\n",
|
||||
"Me: 2211 this\n",
|
||||
"Me: 112 this\n",
|
||||
|
||||
"Me: 1-650-555-1212 this\n",
|
||||
"Me: (650) 555-1212 this\n",
|
||||
|
||||
Reference in New Issue
Block a user