Changes between Version 10 and Version 11 of Rules/UkrainePhoneNumbers
- Timestamp:
- 2022-05-24T19:53:17+02:00 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Rules/UkrainePhoneNumbers
v10 v11 35 35 36 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")] { 37 throwWarning: tr("Incorrect \"phone\" tag"); 37 throwWarning: tr("{0}", "{0.tag}"); 38 group: tr("Incorrect \"phone\" tag"); 38 39 suggestAlternative: tr("format +380⎵44⎵123⎵4567;+380⎵352⎵12⎵3456;+380⎵5345⎵12⎵345"); 39 40 assertMatch: "node phone=+380 44 366 7002"; … … 41 42 } 42 43 43 *[ /^phone$/=~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] {44 *["phone" =~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] { 44 45 throwError: tr("{0}", ""); 45 46 group: tr("A toll-free phone number is listed in the \"phone\" tag"); … … 47 48 assertMatch: "node phone=0 800 500 609"; 48 49 assertMatch: "way phone=0 800 500 609"; 49 assertNoMatch: "node phone:UA=0 50 assertNoMatch: "way phone:UA=0 50 assertNoMatch: "node phone:UA=0800 500 609"; 51 assertNoMatch: "way phone:UA=0800 500 609"; 51 52 } 52 53 53 *["emergency:phone"]["emergency:phone" !~ /^(;?(?=(112|10[1-49]))(?=.*(112|10[1-49]))(112|10[1-49]))*$/] { 54 *[/^(contact:)?(phone|fax)(?!:UA)$/][/^(contact:)?(phone|fax)(?!:UA)$/ =~ /800(([ -]\d{3}){2}|([ -]\d{2}){3})/][inside("UA")] { 55 throwWarning: tr("{0}", "{0.tag}"); 56 group: tr("Toll-free number among other phones"); 57 suggestAlternative: tr("ex. phone:UA=0⎵800⎵300⎵545"); 58 } 59 60 *["phone:UA"]["phone:UA" !~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] { 61 throwWarning: tr("{0}", "{0.tag}"); 62 group: tr("Incorrect format of the toll-free number"); 63 suggestAlternative: tr("ex. phone:UA=0⎵800⎵300⎵545"); 64 } 65 66 *["emergency:phone"]["emergency:phone" !~ /^(;?(?=(112|10[1-49]))(?=.*(112|10[1-49]))(112|10[1-49]))*$/][inside("UA")] { 54 67 throwWarning: tr("({0}). \"emergency:phone=*\" value must be one of 112, 101, 102, 103, 104, 109", "{0.tag}"); 55 68 } 56 69 57 *[/^(contact:)?(phone|fax)(?!:UA)$/ =~ /^.*(;?(?=\b(112|10[1-49])\b)(112|10[1-49])*)(?<=(112|10[1-49])).*$/] { 70 *[/^(contact:)?(phone|fax)(?!:UA)$/ =~ /^.*(;?(?=\b(112|10[1-49])\b)(112|10[1-49])*)(?<=(112|10[1-49])).*$/][inside("UA")] { 58 71 throwWarning: tr("Emergency phone number is in the \"phone\" tag"); 59 72 suggestAlternative: tr("\"emergency:phone=*\""); 60 73 } 74 75 *[/(phone|fax)/ =~ /; *$/][inside("UA")] { 76 throwWarning: tr("{0}", ""); 77 group: tr("Empty value after \";\" at the end of the tag"); 78 } 61 79 }}}