Version 8 (modified by 2 years ago) ( diff ) | ,
---|
Validation of phone numbers in Ukraine
The phone number must conform to the format +380 aa xxx xxxx;+380 aaa xx xxxx;+380 аааа хх ххх
, where:
+380
is the code of Ukraine,аа
/ааа
/аааа
is the code of the operator or area,ххх хххх
/хх хххх
/хх ххх
- number format for seven-, six- and five-digit numbers that can be used in the local network without using the network code.
Toll-free phones 0 800 ххх ххх
must be specified without a country code, the phone:UA
key is used to record them.
meta { title: "Ukrainian phone numbers"; version: "0.12_2022-05-27"; description: "Verify Ukrainian phone numbers formating and validity. Rules for checking phone number formats in Ukraine. The phone must conform to the format `+380 aa xxx xxxx;+380 aaa xx xxxx;+380 аааа хх ххх`, where `+380` is the code of Ukraine, `аа` / `ааа` / `аааа` is the code of the operator or area, `ххх хххх` / `хх хххх` / `хх ххх` - number format for seven-, six- and five-digit numbers that can be used in the local network without using the network code. Toll-free phones `0 800 ххх ххх` must be specified without a country code, the `phone:UA` key is used to record them."; author: "code: andygol; icon: gontsa"; icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTAwIiBoZWlnaHQ9IjYwMCIgdmVyc2lvbj0iMS4xIiBpZD0ic3ZnMTgwMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcyBpZD0iZGVmczE4MDQiPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyIgaWQ9InN0eWxlMjA3NyI+LmZpbDAsLmZpbDF7ZmlsbDojMWIxYzFmfS5maWwxe2ZpbGwtcnVsZTpub256ZXJvfTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJnMjAxOCIgdHJhbnNmb3JtPSJzY2FsZSguNzUpIj48cGF0aCBmaWxsPSIjMDA1YmJiIiBpZD0icmVjdDIwMDYiIGQ9Ik0wIDBoMTIwMHY4MDBIMHoiLz48cGF0aCBmaWxsPSIjZmZkNTAwIiBpZD0icmVjdDIwMDgiIGQ9Ik0w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LTYuMjE2LTYuMjE2LTE2LjU0MS02LjAyNy0yMy4wMDEuNDMzbC04LjgxOCA4Ljg2OC4yNDMuMjRjLTIuOTU2IDMuNzcyLTUuNDI5IDguMTI0LTcuMjY1IDEyLjgxNi0xLjY5NiA0LjQ2Ni0yLjc1MiA4LjcyOS0zLjIzNSAxMi45OTgtNC4xMyAzNC4yNSAxMS41MiA2NS41NSA1My45OTQgMTA4LjAyOCA1OC43MTEgNTguNzA3IDEwNi4wMjcgNTQuMjczIDEwOC4wNjcgNTQuMDU1IDQuNDQ5LS41MyA4LjcwNy0xLjU5MyAxMy4wMzgtMy4yNzUgNC42NTItMS44MTggOS4wMDEtNC4yODQgMTIuNzY5LTcuMjMzbC4xOTMuMTY4IDguOTMzLTguNzQ3YzYuNDQ2LTYuNDU5IDYuNjMyLTE2Ljc3Ny40MTUtMjMuMDE1eiIgaWQ9InBhdGgyMjQwIi8+PC9nPjwvZz48L2c+PC9zdmc+"; link: "https://josm.openstreetmap.de/wiki/Rules/UkrainePhoneNumbers"; min-josm-version: "11424"; /* due to territory selectors */ baselanguage: "en"; } meta[lang=uk] { title: "Правила перевірки форматів телефонних номерів в Україні"; description: "Правила перевірки форматів номерів телефонів в Україні. Телефон має відповідати формату `+380 aa xxx xxxx;+380 aaa xx xxxx;+380 аааа хх ххх`, де `+380` - код України, `аа` / `ааа` / `аааа` - код оператора чи території, `ххх хххх` / `хх хххх` / `хх ххх` - формат номерів для семи-, шести- та п'ятизначних номерів, що можуть використовуватись в місцевій мережі без використання коду мережі. Телефони `0 800 ххх ххх` мають вказуватись без коду країни, для їх запису використовується ключ `phone:UA`"; } *[/^(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")] { throwWarning: tr("Incorrect \"phone\" tag"); suggestAlternative: tr("format +380⎵44⎵123⎵4567;+380⎵352⎵12⎵3456;+380⎵5345⎵12⎵345"); assertMatch: "node phone=+380 44 366 7002"; assertNoMatch: "node phone=+38 044 366 7002"; } *[/^phone$/ =~ /^(;?(0 800 \d{3} \d{3}))*$/][inside("UA")] { throwError: tr("{0}", ""); group: tr("A toll-free phone number is listed in the \"phone\" tag"); fixChangeKey: "phone=>phone:UA"; assertMatch: "node phone=0 800 500 609"; assertMatch: "way phone=0 800 500 609"; assertNoMatch: "node phone:UA=0 800 500 609"; assertNoMatch: "way phone:UA=0 800 500 609"; }
Rules_UkrainePhoneNumbers.validator.mapcss, Rules_UkrainePhoneNumbers.zip
Attachments (1)
-
Flag_of_Ukraine_phone_check.svg
(1.5 KB
) - added by 2 years ago.
Validator Icon, reuploaded icon of andygol but with: (NOZIP)
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.