Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / components / autofill / core / browser / autofill_regex_constants.cc
blob4aed1a53c579b8817bdca54a10f75b9a3053601d
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains UTF8 strings that we want as char arrays. To avoid
6 // different compilers, we use a script to convert the UTF8 strings into
7 // numeric literals (\x##).
9 #include "components/autofill/core/browser/autofill_regex_constants.h"
11 namespace autofill {
13 /////////////////////////////////////////////////////////////////////////////
14 // address_field.cc
15 /////////////////////////////////////////////////////////////////////////////
16 const char kAttentionIgnoredRe[] = "attention|attn";
17 const char kRegionIgnoredRe[] =
18 "province|region|other"
19 "|provincia" // es
20 "|bairro|suburb"; // pt-BR, pt-PT
21 const char kCompanyRe[] =
22 "company|business|organization|organisation"
23 "|firma|firmenname" // de-DE
24 "|empresa" // es
25 "|societe|société" // fr-FR
26 "|ragione.?sociale" // it-IT
27 "|会社" // ja-JP
28 "|название.?компании" // ru
29 "|单位|公司" // zh-CN
30 "|회사|직장"; // ko-KR
31 const char kAddressLine1Re[] =
32 "address.*line|address1|addr1|street"
33 "|(shipping|billing)address$"
34 "|strasse|straße|hausnummer|housenumber" // de-DE
35 "|house.?name" // en-GB
36 "|direccion|dirección" // es
37 "|adresse" // fr-FR
38 "|indirizzo" // it-IT
39 "|住所1" // ja-JP
40 "|morada|endereço" // pt-BR, pt-PT
41 "|Адрес" // ru
42 "|地址" // zh-CN
43 "|주소.?1"; // ko-KR
44 const char kAddressLine1LabelRe[] =
45 "address"
46 "|adresse" // fr-FR
47 "|indirizzo" // it-IT
48 "|住所" // ja-JP
49 "|地址" // zh-CN
50 "|주소"; // ko-KR
51 const char kAddressLine2Re[] =
52 "address.*line2|address2|addr2|street|suite|unit"
53 "|adresszusatz|ergänzende.?angaben" // de-DE
54 "|direccion2|colonia|adicional" // es
55 "|addresssuppl|complementnom|appartement" // fr-FR
56 "|indirizzo2" // it-IT
57 "|住所2" // ja-JP
58 "|complemento|addrcomplement" // pt-BR, pt-PT
59 "|Улица" // ru
60 "|地址2" // zh-CN
61 "|주소.?2"; // ko-KR
62 const char kAddressLine2LabelRe[] =
63 "address|line"
64 "|adresse" // fr-FR
65 "|indirizzo" // it-IT
66 "|地址" // zh-CN
67 "|주소"; // ko-KR
68 const char kAddressLinesExtraRe[] =
69 "address.*line[3-9]|address[3-9]|addr[3-9]|street|line[3-9]"
70 "|municipio" // es
71 "|batiment|residence" // fr-FR
72 "|indirizzo[3-9]"; // it-IT
73 const char kAddressLookupRe[] =
74 "lookup";
75 const char kCountryRe[] =
76 "country|countries"
77 "|país|pais" // es
78 "|国" // ja-JP
79 "|国家" // zh-CN
80 "|국가|나라"; // ko-KR
81 const char kCountryLocationRe[] =
82 "location";
83 const char kZipCodeRe[] =
84 "zip|postal|post.*code|pcode"
85 "|pin.?code" // en-IN
86 "|postleitzahl" // de-DE
87 "|\\bcp\\b" // es
88 "|\\bcdp\\b" // fr-FR
89 "|\\bcap\\b" // it-IT
90 "|郵便番号" // ja-JP
91 "|codigo|codpos|\\bcep\\b" // pt-BR, pt-PT
92 "|Почтовый.?Индекс" // ru
93 "|邮政编码|邮编" // zh-CN
94 "|郵遞區號" // zh-TW
95 "|우편.?번호"; // ko-KR
96 const char kZip4Re[] =
97 "zip|^-$|post2"
98 "|codpos2"; // pt-BR, pt-PT
99 const char kCityRe[] =
100 "city|town"
101 "|\\bort\\b|stadt" // de-DE
102 "|suburb" // en-AU
103 "|ciudad|provincia|localidad|poblacion" // es
104 "|ville|commune" // fr-FR
105 "|localita" // it-IT
106 "|市区町村" // ja-JP
107 "|cidade" // pt-BR, pt-PT
108 "|Город" // ru
109 "|市" // zh-CN
110 "|分區" // zh-TW
111 "|^시[^도·・]|시[·・]?군[·・]?구"; // ko-KR
112 const char kStateRe[] =
113 "(?<!united )state|county|region|province"
114 "|land" // de-DE
115 "|county|principality" // en-UK
116 "|都道府県" // ja-JP
117 "|estado|provincia" // pt-BR, pt-PT
118 "|область" // ru
119 "|省" // zh-CN
120 "|地區" // zh-TW
121 "|^시[·・]?도"; // ko-KR
123 /////////////////////////////////////////////////////////////////////////////
124 // credit_card_field.cc
125 /////////////////////////////////////////////////////////////////////////////
126 const char kNameOnCardRe[] =
127 "card.?(holder|owner)|name.*\\bon\\b.*card|(card|cc).?name|cc.?full.?name"
128 "|karteninhaber" // de-DE
129 "|nombre.*tarjeta" // es
130 "|nom.*carte" // fr-FR
131 "|nome.*cart" // it-IT
132 "|名前" // ja-JP
133 "|Имя.*карты" // ru
134 "|信用卡开户名|开户名|持卡人姓名" // zh-CN
135 "|持卡人姓名"; // zh-TW
136 const char kNameOnCardContextualRe[] =
137 "name";
138 const char kCardNumberRe[] =
139 "(card|cc|acct).?(number|#|no|num)"
140 "|nummer" // de-DE
141 "|credito|numero|número" // es
142 "|numéro" // fr-FR
143 "|カード番号" // ja-JP
144 "|Номер.*карты" // ru
145 "|信用卡号|信用卡号码" // zh-CN
146 "|信用卡卡號" // zh-TW
147 "|카드"; // ko-KR
148 const char kCardCvcRe[] =
149 "verification|card identification|security code|card code"
150 "|cvn|cvv|cvc|csc|cvd|cid|ccv"
151 "|\\bcid\\b";
153 // "Expiration date" is the most common label here, but some pages have
154 // "Expires", "exp. date" or "exp. month" and "exp. year". We also look
155 // for the field names ccmonth and ccyear, which appear on at least 4 of
156 // our test pages.
158 // On at least one page (The China Shop2.html) we find only the labels
159 // "month" and "year". So for now we match these words directly; we'll
160 // see if this turns out to be too general.
162 // Toolbar Bug 51451: indeed, simply matching "month" is too general for
163 // https://rps.fidelity.com/ftgw/rps/RtlCust/CreatePIN/Init.
164 // Instead, we match only words beginning with "month".
165 const char kExpirationMonthRe[] =
166 "expir|exp.*mo|exp.*date|ccmonth|cardmonth"
167 "|gueltig|gültig|monat" // de-DE
168 "|fecha" // es
169 "|date.*exp" // fr-FR
170 "|scadenza" // it-IT
171 "|有効期限" // ja-JP
172 "|validade" // pt-BR, pt-PT
173 "|Срок действия карты" // ru
174 "|月"; // zh-CN
175 const char kExpirationYearRe[] =
176 "exp|^/|year"
177 "|ablaufdatum|gueltig|gültig|yahr" // de-DE
178 "|fecha" // es
179 "|scadenza" // it-IT
180 "|有効期限" // ja-JP
181 "|validade" // pt-BR, pt-PT
182 "|Срок действия карты" // ru
183 "|年|有效期"; // zh-CN
185 // The "yy" portion of the regex is just looking for two adjacent y's.
186 const char kExpirationDate2DigitYearRe[] =
187 "(exp.*date.*|mm\\s*[-/]\\s*)[^y]yy([^y]|$)";
188 const char kExpirationDate4DigitYearRe[] =
189 "^mm\\s*[-/]\\syyyy$";
190 const char kExpirationDateRe[] =
191 "expir|exp.*date"
192 "|gueltig|gültig" // de-DE
193 "|fecha" // es
194 "|date.*exp" // fr-FR
195 "|scadenza" // it-IT
196 "|有効期限" // ja-JP
197 "|validade" // pt-BR, pt-PT
198 "|Срок действия карты"; // ru
199 const char kGiftCardRe[] =
200 "gift.?card";
201 const char kDebitGiftCardRe[] =
202 "(visa|mastercard|discover|amex|american express).*gift.?card";
203 const char kDebitCardRe[] =
204 "debit.*card";
207 /////////////////////////////////////////////////////////////////////////////
208 // email_field.cc
209 /////////////////////////////////////////////////////////////////////////////
210 const char kEmailRe[] =
211 "e.?mail"
212 "|courriel" // fr
213 "|メールアドレス" // ja-JP
214 "|Электронной.?Почты" // ru
215 "|邮件|邮箱" // zh-CN
216 "|電郵地址" // zh-TW
217 "|(이메일|전자.?우편|[Ee]-?mail)(.?주소)?"; // ko-KR
220 /////////////////////////////////////////////////////////////////////////////
221 // name_field.cc
222 /////////////////////////////////////////////////////////////////////////////
223 const char kNameIgnoredRe[] =
224 "user.?name|user.?id|nickname|maiden name|title|prefix|suffix"
225 "|vollständiger.?name" // de-DE
226 "|用户名" // zh-CN
227 "|(사용자.?)?아이디|사용자.?ID"; // ko-KR
228 const char kNameRe[] =
229 "^name|full.?name|your.?name|customer.?name|bill.?name|ship.?name"
230 "|name.*first.*last|firstandlastname"
231 "|nombre.*y.*apellidos" // es
232 "|^nom" // fr-FR
233 "|お名前|氏名" // ja-JP
234 "|^nome" // pt-BR, pt-PT
235 "|姓名" // zh-CN
236 "|성명"; // ko-KR
237 const char kNameSpecificRe[] =
238 "^name"
239 "|^nom" // fr-FR
240 "|^nome"; // pt-BR, pt-PT
241 const char kFirstNameRe[] =
242 "first.*name|initials|fname|first$|given.*name"
243 "|vorname" // de-DE
244 "|nombre" // es
245 "|forename|prénom|prenom" // fr-FR
246 "|名" // ja-JP
247 "|nome" // pt-BR, pt-PT
248 "|Имя" // ru
249 "|이름"; // ko-KR
250 const char kMiddleInitialRe[] = "middle.*initial|m\\.i\\.|mi$|\\bmi\\b";
251 const char kMiddleNameRe[] =
252 "middle.*name|mname|middle$"
253 "|apellido.?materno|lastlastname"; // es
254 const char kLastNameRe[] =
255 "last.*name|lname|surname|last$|secondname|family.*name"
256 "|nachname" // de-DE
257 "|apellido" // es
258 "|famille|^nom" // fr-FR
259 "|cognome" // it-IT
260 "|姓" // ja-JP
261 "|morada|apelidos|surename|sobrenome" // pt-BR, pt-PT
262 "|Фамилия" // ru
263 "|성[^명]?"; // ko-KR
265 /////////////////////////////////////////////////////////////////////////////
266 // phone_field.cc
267 /////////////////////////////////////////////////////////////////////////////
268 const char kPhoneRe[] =
269 "phone|mobile"
270 "|telefonnummer" // de-DE
271 "|telefono|teléfono" // es
272 "|telfixe" // fr-FR
273 "|電話" // ja-JP
274 "|telefone|telemovel" // pt-BR, pt-PT
275 "|телефон" // ru
276 "|电话" // zh-CN
277 "|(전화|핸드폰|휴대폰|휴대전화)(.?번호)?"; // ko-KR
278 const char kCountryCodeRe[] =
279 "country.*code|ccode|_cc";
280 const char kAreaCodeNotextRe[] =
281 "^\\($";
282 const char kAreaCodeRe[] =
283 "area.*code|acode|area"
284 "|지역.?번호"; // ko-KR
285 const char kPhonePrefixSeparatorRe[] =
286 "^-$|^\\)$";
287 const char kPhoneSuffixSeparatorRe[] =
288 "^-$";
289 const char kPhonePrefixRe[] =
290 "prefix|exchange"
291 "|preselection" // fr-FR
292 "|ddd"; // pt-BR, pt-PT
293 const char kPhoneSuffixRe[] =
294 "suffix";
295 const char kPhoneExtensionRe[] =
296 "\\bext|ext\\b|extension"
297 "|ramal"; // pt-BR, pt-PT
299 } // namespace autofill