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

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: 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 22cc38615236daab329093c9d949acedc9f7b80c..d18f765ded9e97612031081c91f3438b7d5fb8cd 100644
--- a/components/autofill/core/browser/autofill_regex_constants.cc.utf8
+++ b/components/autofill/core/browser/autofill_regex_constants.cc.utf8
@@ -182,10 +182,13 @@ const char kExpirationYearRe[] =
"|Срок действия карты" // ru
"|年|有效期"; // zh-CN
-// This regex is a little bit nasty, but it is simply requiring exactly two
-// adjacent y's.
const char kExpirationDate2DigitYearRe[] =
- "exp.*date.*[^y]yy([^y]|$)";
+ "^mm\\s*[-/]\\syy$"
+ // This regex is a little bit nasty, but it is simply requiring exactly two
+ // adjacent y's.
+ "|exp.*date.*[^y]yy([^y]|$)";
Evan Stade 2015/04/03 20:07:00 ^mm\\s*[-/]\\syy$ seems a bit too specific to the
Lei Zhang 2015/04/03 22:37:33 Done.
+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