OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 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##). |
| 8 |
| 9 #include "chrome/browser/autofill/autofill_regex_constants.h" |
| 10 |
| 11 namespace autofill { |
| 12 |
| 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 "|strasse|straße|hausnummer|housenumber" // de-DE |
| 34 "|house.?name" // en-GB |
| 35 "|direccion|dirección" // es |
| 36 "|adresse" // fr-FR |
| 37 "|indirizzo" // it-IT |
| 38 "|住所1" // ja-JP |
| 39 "|morada|endereço" // pt-BR, pt-PT |
| 40 "|Адрес" // ru |
| 41 "|地址" // zh-CN |
| 42 "|주소.?1"; // ko-KR |
| 43 const char kAddressLine1LabelRe[] = |
| 44 "address" |
| 45 "|adresse" // fr-FR |
| 46 "|indirizzo" // it-IT |
| 47 "|住所" // ja-JP |
| 48 "|地址" // zh-CN |
| 49 "|주소"; // ko-KR |
| 50 const char kAddressLine2Re[] = |
| 51 "address.*line2|address2|addr2|street|suite|unit" |
| 52 "|adresszusatz|ergänzende.?angaben" // de-DE |
| 53 "|direccion2|colonia|adicional" // es |
| 54 "|addresssuppl|complementnom|appartement" // fr-FR |
| 55 "|indirizzo2" // it-IT |
| 56 "|住所2" // ja-JP |
| 57 "|complemento|addrcomplement" // pt-BR, pt-PT |
| 58 "|Улица" // ru |
| 59 "|地址2" // zh-CN |
| 60 "|주소.?2"; // ko-KR |
| 61 const char kAddressLine2LabelRe[] = |
| 62 "address" |
| 63 "|adresse" // fr-FR |
| 64 "|indirizzo" // it-IT |
| 65 "|地址" // zh-CN |
| 66 "|주소"; // ko-KR |
| 67 const char kAddressLine3Re[] = |
| 68 "address.*line3|address3|addr3|street|line3" |
| 69 "|municipio" // es |
| 70 "|batiment|residence" // fr-FR |
| 71 "|indirizzo3"; // it-IT |
| 72 const char kCountryRe[] = |
| 73 "country|countries|location" |
| 74 "|país|pais" // es |
| 75 "|国" // ja-JP |
| 76 "|国家" // zh-CN |
| 77 "|국가|나라"; // ko-KR |
| 78 const char kZipCodeRe[] = |
| 79 "zip|postal|post.*code|pcode|^1z$" |
| 80 "|postleitzahl" // de-DE |
| 81 "|\\bcp\\b" // es |
| 82 "|\\bcdp\\b" // fr-FR |
| 83 "|\\bcap\\b" // it-IT |
| 84 "|郵便番号" // ja-JP |
| 85 "|codigo|codpos|\\bcep\\b" // pt-BR, pt-PT |
| 86 "|Почтовый.?Индекс" // ru |
| 87 "|邮政编码|邮编" // zh-CN |
| 88 "|郵遞區號" // zh-TW |
| 89 "|우편.?번호"; // ko-KR |
| 90 const char kZip4Re[] = |
| 91 "zip|^-$|post2" |
| 92 "|codpos2"; // pt-BR, pt-PT |
| 93 const char kCityRe[] = |
| 94 "city|town" |
| 95 "|\\bort\\b|stadt" // de-DE |
| 96 "|suburb" // en-AU |
| 97 "|ciudad|provincia|localidad|poblacion" // es |
| 98 "|ville|commune" // fr-FR |
| 99 "|localita" // it-IT |
| 100 "|市区町村" // ja-JP |
| 101 "|cidade" // pt-BR, pt-PT |
| 102 "|Город" // ru |
| 103 "|市" // zh-CN |
| 104 "|分區" // zh-TW |
| 105 "|^시[^도·・]|시[·・]?군[·・]?구"; // ko-KR |
| 106 const char kStateRe[] = |
| 107 "(?<!united )state|county|region|province" |
| 108 "|land" // de-DE |
| 109 "|county|principality" // en-UK |
| 110 "|都道府県" // ja-JP |
| 111 "|estado|provincia" // pt-BR, pt-PT |
| 112 "|область" // ru |
| 113 "|省" // zh-CN |
| 114 "|地區" // zh-TW |
| 115 "|^시[·・]?도"; // ko-KR |
| 116 const char kAddressTypeSameAsRe[] = "same as"; |
| 117 const char kAddressTypeUseMyRe[] = "use my"; |
| 118 const char kBillingDesignatorRe[] = "bill"; |
| 119 const char kShippingDesignatorRe[] = "ship"; |
| 120 |
| 121 ///////////////////////////////////////////////////////////////////////////// |
| 122 // credit_card_field.cc |
| 123 ///////////////////////////////////////////////////////////////////////////// |
| 124 const char kNameOnCardRe[] = |
| 125 "card.?holder|name.?on.?card|ccname|ccfullname|owner" |
| 126 "|karteninhaber" // de-DE |
| 127 "|nombre.*tarjeta" // es |
| 128 "|nom.*carte" // fr-FR |
| 129 "|nome.*cart" // it-IT |
| 130 "|名前" // ja-JP |
| 131 "|Имя.*карты" // ru |
| 132 "|信用卡开户名|开户名|持卡人姓名" // zh-CN |
| 133 "|持卡人姓名"; // zh-TW |
| 134 const char kNameOnCardContextualRe[] = |
| 135 "name"; |
| 136 const char kCardNumberRe[] = |
| 137 "card.?number|card.?#|card.?no|ccnum|acctnum" |
| 138 "|nummer" // de-DE |
| 139 "|credito|numero|número" // es |
| 140 "|numéro" // fr-FR |
| 141 "|カード番号" // ja-JP |
| 142 "|Номер.*карты" // ru |
| 143 "|信用卡号|信用卡号码" // zh-CN |
| 144 "|信用卡卡號" // zh-TW |
| 145 "|카드"; // ko-KR |
| 146 const char kCardCvcRe[] = |
| 147 "verification|card identification|security code|cvn|cvv|cvc|csc"; |
| 148 |
| 149 // "Expiration date" is the most common label here, but some pages have |
| 150 // "Expires", "exp. date" or "exp. month" and "exp. year". We also look |
| 151 // for the field names ccmonth and ccyear, which appear on at least 4 of |
| 152 // our test pages. |
| 153 |
| 154 // On at least one page (The China Shop2.html) we find only the labels |
| 155 // "month" and "year". So for now we match these words directly; we'll |
| 156 // see if this turns out to be too general. |
| 157 |
| 158 // Toolbar Bug 51451: indeed, simply matching "month" is too general for |
| 159 // https://rps.fidelity.com/ftgw/rps/RtlCust/CreatePIN/Init. |
| 160 // Instead, we match only words beginning with "month". |
| 161 const char kExpirationMonthRe[] = |
| 162 "expir|exp.*mo|exp.*date|ccmonth" |
| 163 "|gueltig|gültig|monat" // de-DE |
| 164 "|fecha" // es |
| 165 "|date.*exp" // fr-FR |
| 166 "|scadenza" // it-IT |
| 167 "|有効期限" // ja-JP |
| 168 "|validade" // pt-BR, pt-PT |
| 169 "|Срок действия карты" // ru |
| 170 "|月"; // zh-CN |
| 171 const char kExpirationYearRe[] = |
| 172 "exp|^/|year" |
| 173 "|ablaufdatum|gueltig|gültig|yahr" // de-DE |
| 174 "|fecha" // es |
| 175 "|scadenza" // it-IT |
| 176 "|有効期限" // ja-JP |
| 177 "|validade" // pt-BR, pt-PT |
| 178 "|Срок действия карты" // ru |
| 179 "|年|有效期"; // zh-CN |
| 180 |
| 181 // This regex is a little bit nasty, but it is simply requiring exactly two |
| 182 // adjacent y's. |
| 183 const char kExpirationDate2DigitYearRe[] = |
| 184 "exp.*date.*[^y]yy([^y]|$)"; |
| 185 const char kExpirationDateRe[] = |
| 186 "expir|exp.*date" |
| 187 "|gueltig|gültig" // de-DE |
| 188 "|fecha" // es |
| 189 "|date.*exp" // fr-FR |
| 190 "|scadenza" // it-IT |
| 191 "|有効期限" // ja-JP |
| 192 "|validade" // pt-BR, pt-PT |
| 193 "|Срок действия карты"; // ru |
| 194 const char kCardIgnoredRe[] = |
| 195 "^card"; |
| 196 |
| 197 |
| 198 ///////////////////////////////////////////////////////////////////////////// |
| 199 // email_field.cc |
| 200 ///////////////////////////////////////////////////////////////////////////// |
| 201 const char kEmailRe[] = |
| 202 "e.?mail" |
| 203 "|メールアドレス" // ja-JP |
| 204 "|Электронной.?Почты" // ru |
| 205 "|邮件|邮箱" // zh-CN |
| 206 "|電郵地址" // zh-TW |
| 207 "|(이메일|전자.?우편|[Ee]-?mail)(.?주소)?"; // ko-KR |
| 208 |
| 209 |
| 210 ///////////////////////////////////////////////////////////////////////////// |
| 211 // name_field.cc |
| 212 ///////////////////////////////////////////////////////////////////////////// |
| 213 const char kNameIgnoredRe[] = |
| 214 "user.?name|user.?id|nickname|maiden name|title|prefix|suffix" |
| 215 "|vollständiger.?name" // de-DE |
| 216 "|用户名" // zh-CN |
| 217 "|(사용자.?)?아이디|사용자.?ID"; // ko-KR |
| 218 const char kNameRe[] = |
| 219 "^name|full.?name|your.?name|customer.?name|firstandlastname|bill.?name" |
| 220 "|ship.?name" |
| 221 "|nombre.*y.*apellidos" // es |
| 222 "|^nom" // fr-FR |
| 223 "|お名前|氏名" // ja-JP |
| 224 "|^nome" // pt-BR, pt-PT |
| 225 "|姓名" // zh-CN |
| 226 "|성명"; // ko-KR |
| 227 const char kNameSpecificRe[] = |
| 228 "^name" |
| 229 "|^nom" // fr-FR |
| 230 "|^nome"; // pt-BR, pt-PT |
| 231 const char kFirstNameRe[] = |
| 232 "first.*name|initials|fname|first$" |
| 233 "|vorname" // de-DE |
| 234 "|nombre" // es |
| 235 "|forename|prénom|prenom" // fr-FR |
| 236 "|名" // ja-JP |
| 237 "|nome" // pt-BR, pt-PT |
| 238 "|Имя" // ru |
| 239 "|이름"; // ko-KR |
| 240 const char kMiddleInitialRe[] = "middle.*initial|m\\.i\\.|mi$|\\bmi\\b"; |
| 241 const char kMiddleNameRe[] = |
| 242 "middle.*name|mname|middle$" |
| 243 "|apellido.?materno|lastlastname"; // es |
| 244 const char kLastNameRe[] = |
| 245 "last.*name|lname|surname|last$|secondname" |
| 246 "|nachname" // de-DE |
| 247 "|apellido" // es |
| 248 "|famille|^nom" // fr-FR |
| 249 "|cognome" // it-IT |
| 250 "|姓" // ja-JP |
| 251 "|morada|apelidos|surename|sobrenome" // pt-BR, pt-PT |
| 252 "|Фамилия" // ru |
| 253 "|성[^명]?"; // ko-KR |
| 254 |
| 255 ///////////////////////////////////////////////////////////////////////////// |
| 256 // phone_field.cc |
| 257 ///////////////////////////////////////////////////////////////////////////// |
| 258 const char kPhoneRe[] = |
| 259 "phone|mobile" |
| 260 "|telefonnummer" // de-DE |
| 261 "|telefono|teléfono" // es |
| 262 "|telfixe" // fr-FR |
| 263 "|電話" // ja-JP |
| 264 "|telefone|telemovel" // pt-BR, pt-PT |
| 265 "|телефон" // ru |
| 266 "|电话" // zh-CN |
| 267 "|(전화|핸드폰|휴대폰|휴대전화)(.?번호)?"; // ko-KR |
| 268 const char kCountryCodeRe[] = |
| 269 "country.*code|ccode|_cc"; |
| 270 const char kAreaCodeNotextRe[] = |
| 271 "^\\($"; |
| 272 const char kAreaCodeRe[] = |
| 273 "area.*code|acode|area" |
| 274 "|지역.?번호"; // ko-KR |
| 275 const char kFaxRe[] = |
| 276 "fax" |
| 277 "|télécopie|telecopie" // fr-FR |
| 278 "|ファックス" // ja-JP |
| 279 "|факс" // ru |
| 280 "|传真" // zh-CN |
| 281 "|傳真" // zh-TW |
| 282 "|팩스(.?번호)?"; // ko-KR |
| 283 const char kPhonePrefixSeparatorRe[] = |
| 284 "^-$|^\\)$"; |
| 285 const char kPhoneSuffixSeparatorRe[] = |
| 286 "^-$"; |
| 287 const char kPhonePrefixRe[] = |
| 288 "prefix|exchange" |
| 289 "|preselection" // fr-FR |
| 290 "|ddd"; // pt-BR, pt-PT |
| 291 const char kPhoneSuffixRe[] = |
| 292 "suffix"; |
| 293 const char kPhoneExtensionRe[] = |
| 294 "\\bext|ext\\b|extension" |
| 295 "|ramal"; // pt-BR, pt-PT |
| 296 |
| 297 } // namespace autofill |
OLD | NEW |