| Title: | Parse phone numbers |
|---|---|
| Description: | Parse phone numbers using the Rust crate 'phonenumber'. Includes validation of numbers and formatting. |
| Authors: | David Schoch [aut, cre] (ORCID: <https://orcid.org/0000-0003-2952-4812>) |
| Maintainer: | David Schoch <[email protected]> |
| License: | Apache License (== 2) |
| Version: | 0.0.1.9000 |
| Built: | 2026-04-01 05:29:52 UTC |
| Source: | https://github.com/schochastics/dialrs |
Parse phone numbers using the Rust crate 'phonenumber'. Includes validation of numbers and formatting.
Maintainer: David Schoch [email protected] (ORCID)
Useful links:
A set of fake phone numbers for testing
fake_phonefake_phone
An object of class character of length 100.
Extract country code from phone numbers
phone_country_code(phone)phone_country_code(phone)
phone |
character vector of phone numbers |
integer vector of country codes phone_country_code("+4916012345678")
Print Rust internal phonenumber for debugging purposes
phone_debug_print(input, country)phone_debug_print(input, country)
input |
character. a phone number to parse |
country |
character. CLDR code |
nothing just used for side effects
Check if strings are valid phone numbers
phone_is_valid(phone, country = "")phone_is_valid(phone, country = "")
phone |
character vector of phone numbers |
country |
CLDR country code. If empty, tries to parse it from |
TRUE if valid phone number, FALSE otherwise
phone_is_valid(fake_phone)phone_is_valid(fake_phone)
Parse phone numbers into specific format
phone_parse(phone, country = "", format)phone_parse(phone, country = "", format)
phone |
character vector of phone numbers |
country |
CLDR country code. If empty, tries to parse it from |
format |
character. one of "International", "National", "RFC3966", "E.164" |
character vector of parsed and formatted phone numbers phone_parse(fake_phone,format = "RFC3966") phone_parse("016012345678",country = "DE",format = "International")
Return type of phone number
phone_type(phone, country = "")phone_type(phone, country = "")
phone |
character vector of phone numbers |
country |
CLDR country code. If empty, tries to parse it from |
character vector of phone number types
phone_type(fake_phone)phone_type(fake_phone)