Add more tests, better error handling

This commit is contained in:
Vlasislav Kashin
2025-07-13 14:49:56 +03:00
parent ebe7d236e9
commit beae04dee8
4 changed files with 1075 additions and 82 deletions

View File

@@ -307,7 +307,7 @@ impl PhoneNumberRegExpsAndMappings {
separator_pattern: Regex::new(&format!("[{}]+", VALID_PUNCTUATION)).unwrap(),
extn_patterns_for_matching: create_extn_pattern(false),
extn_pattern: Regex::new(&format!("(?i)(?:{})$", &extn_patterns_for_parsing)).unwrap(),
valid_phone_number_pattern: Regex::new(&format!("(?i)(?:{})(?:{})?",
valid_phone_number_pattern: Regex::new(&format!("(?i)^(?:{})(?:{})?$",
&valid_phone_number,
&extn_patterns_for_parsing
)).unwrap(),