Changes between Version 11 and Version 12 of Rules/UkrainePhoneNumbers
- Timestamp:
- 2022-05-27T20:29:46+02:00 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Rules/UkrainePhoneNumbers
v11 v12 8 8 Toll-free phones `0 800 ххх ххх` must be specified without a country code, the `phone:UA` key is used to record them. 9 9 10 Use `emergency:phone=*` tag to addemergency numbers.10 Use `emergency:phone=*` tag for adding emergency numbers. 11 11 - 112 - general emergency number, one for all services 12 12 - 101 - firefighters … … 15 15 - 104 - gas service 16 16 - 109 - information desk 17 18 Use `contact:phone=*` tag for adding short service numbers. So far, the rules for checking the short number of PrivatBank (3700). 17 19 18 20 {{{ … … 34 36 } 35 37 36 *[/^(contact:)?(phone|fax)(?!:UA)$/][/^(contact:)?(phone|fax)(?!:UA)$/ !~ /^((;?(?=(\+\b380 [3-9][0-9][0-9 ]{9}\b)|(0 800 \d{3} \d{3}))(?=.*( (0 800 \d{3} \d{3})|(\+\b380 (?:\d{2} \d{3} \d{4}|\d{3} \d{2} \d{4}|\d{4} \d{2} \d{3})\b)))((0 800 \d{3} \d{3})|(\+\b380 (?:\d{2} \d{3} \d{4}|\d{3} \d{2} \d{4}|\d{4} \d{2} \d{3})\b)))*)$/][inside("UA")] {38 *[/^(contact:)?(phone|fax)(?!:UA)$/][/^(contact:)?(phone|fax)(?!:UA)$/ !~ /^((;?(?=(\+\b380 [3-9][0-9][0-9 ]{9}\b)|(0 800 \d{3} \d{3})|(3700))(?=.*(\b(3700)\b|\b(0 800 \d{3} \d{3})\b|(\+\b380 (?:\d{2} \d{3} \d{4}|\d{3} \d{2} \d{4}|\d{4} \d{2} \d{3})\b)))(\b(3700)\b|\b(0 800 \d{3} \d{3})\b|(\+\b380 (?:\d{2} \d{3} \d{4}|\d{3} \d{2} \d{4}|\d{4} \d{2} \d{3})\b)))*)$/][inside("UA")] { 37 39 throwWarning: tr("{0}", "{0.tag}"); 38 40 group: tr("Incorrect \"phone\" tag"); … … 42 44 } 43 45 44 *["phone" =~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] { 46 *["phone" =~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")], 47 *["contact:phone" =~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] { 45 48 throwError: tr("{0}", ""); 46 49 group: tr("A toll-free phone number is listed in the \"phone\" tag"); 47 fixChangeKey: " phone=>phone:UA";50 fixChangeKey: "{0.key}=>phone:UA"; 48 51 assertMatch: "node phone=0 800 500 609"; 49 52 assertMatch: "way phone=0 800 500 609"; … … 68 71 } 69 72 70 *[/^(contact:)?(phone|fax)(?!:UA)$/ =~ /^.*(;?(?=\b(112|10[1-49])\b)(112|10[1-49])*)(?<=(112|10[1-49])).*$/][inside("UA")] { 73 /*+380 3333 00 102 - fixed. Here, 102 is a part of the number, not an emergency phone by itself*/ 74 *[/^(contact:)?(phone|fax)(?!:UA)$/][/^(contact:)?(phone|fax)(?!:UA)$/ =~ /;?(?=\b(112|10[1-49])\b)(?<! )(112|10[1-49])*/][inside("UA")] { 71 75 throwWarning: tr("Emergency phone number is in the \"phone\" tag"); 72 76 suggestAlternative: tr("\"emergency:phone=*\""); 73 77 } 74 78 75 *[/(phone|fax)/ =~ /; *$/][inside("UA")] { 79 *[/(phone|fax)/ =~ /\d; *$/][inside("UA")] { 76 80 throwWarning: tr("{0}", ""); 77 group: tr("Empty value after \";\" at the end of the tag"); 81 group: tr("Empty value after \";\" at the end of the phone/fax tag"); 82 } 83 84 /* privatbank short number - not tested yet */ 85 *["phone" =~ /\b3700\b/][/^name(:\w\w)?$/ =~ /^(?i)(?u)(ПриватБанк)$/][inside("UA")] { 86 throwError: tr("{0}", ""); 87 group: tr("Privatbank short number is listed in the \"phone\" tag"); 88 suggestAlternative: tr("contact:phone = 3700 for short number"); 78 89 } 79 90 }}}