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

Unified Diff: components/autofill/core/browser/autofill_regex_constants.cc.utf8

Issue 1048363002: Autofill: Recognize more credit card date fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_exp
Patch Set: nit, rebase Created 5 years, 9 months 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
Index: components/autofill/core/browser/autofill_regex_constants.cc.utf8
diff --git a/components/autofill/core/browser/autofill_regex_constants.cc.utf8 b/components/autofill/core/browser/autofill_regex_constants.cc.utf8
index ac1d119e91fa7199167b9b6972546f692d53d199..a4c459433a71f4f7b4fe5f3c78b019fa5fec9556 100644
--- a/components/autofill/core/browser/autofill_regex_constants.cc.utf8
+++ b/components/autofill/core/browser/autofill_regex_constants.cc.utf8
@@ -182,10 +182,11 @@ const char kExpirationYearRe[] =
"|Срок действия карты" // ru
"|年|有效期"; // zh-CN
-// This regex is a little bit nasty, but it is simply requiring exactly two
-// adjacent y's.
+// The "yy" portion of the regex is just looking for two adjacent y's.
const char kExpirationDate2DigitYearRe[] =
- "exp.*date.*[^y]yy([^y]|$)";
+ "(exp.*date.*|mm\\s*[-/]\\s*)[^y]yy([^y]|$)";
+const char kExpirationDate4DigitYearRe[] =
+ "^mm\\s*[-/]\\syyyy$";
const char kExpirationDateRe[] =
"expir|exp.*date"
"|gueltig|gültig" // de-DE
« no previous file with comments | « components/autofill/core/browser/autofill_regex_constants.h ('k') | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698