Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: content/renderer/android/email_detector.cc

Issue 1541093002: Email Regular Expression update for exclusion of invalid domain parts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch Set 2 Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/android/email_detector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/android/email_detector.cc
diff --git a/content/renderer/android/email_detector.cc b/content/renderer/android/email_detector.cc
index 1c335ee117b243234658905f8d8351283057d4ff..9508679badab3f5e5370a40f2bc2c9b5098f55b7 100644
--- a/content/renderer/android/email_detector.cc
+++ b/content/renderer/android/email_detector.cc
@@ -21,7 +21,8 @@ const size_t kMaximumEmailLength = 254;
// disallowed) in order to avoid false positives.
// Delimiters are word boundaries to allow punctuation, quote marks etc. around
// the address.
-const char kEmailRegex[] = "\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\\b";
+const char kEmailRegex[] =
+ "\\b[A-Z0-9._%+-]+@[A-Z0-9-]+(\\.[A-Z0-9-]+)*(\\.[A-Z]{2,6})\\b";
} // anonymous namespace
« no previous file with comments | « no previous file | content/renderer/android/email_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698