mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Issue 17
Changed custom email pattern matching regex to android.util.Patterns.EMAIL_ADDRESS to accommodate valid email addresses the original pattern did not. (e.g. a@aaa.aa, a+aaa@aaa.aaa) This commit is to fix issue 17 (https://github.com/WhisperSystems/TextSecure/issues/17)
This commit is contained in:
parent
6a30867fd4
commit
dc967a8c93
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (C) 2011 Whisper Systems
|
* Copyright (C) 2012 Whisper Systems
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -23,8 +23,7 @@ import android.telephony.PhoneNumberUtils;
|
|||||||
|
|
||||||
public class NumberUtil {
|
public class NumberUtil {
|
||||||
|
|
||||||
private static final String emailExpression = "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
|
private static final Pattern emailPattern = android.util.Patterns.EMAIL_ADDRESS;
|
||||||
private static final Pattern emailPattern = Pattern.compile(emailExpression, Pattern.CASE_INSENSITIVE);
|
|
||||||
|
|
||||||
public static boolean isValidEmail(String number) {
|
public static boolean isValidEmail(String number) {
|
||||||
Matcher matcher = emailPattern.matcher(number);
|
Matcher matcher = emailPattern.matcher(number);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user