Dred Shep
Newbie
- Oct 22, 2018
- 9
- 1
Does anyone here know of a tool that allows me to detect various formats of phone numbers? I need to analyze long texts and find if these long texts have phone numbers.
The problem is that the texts also contain other numbers (amounts and counts, various IDs). I can take some margin of error, and it shouldn't matter whether they have the country code or if the country code is preceded by 00 or +.
They can also have parentheses, spaces, hyphens. I've found a few that take very specific formats. I could make a compilation of those.
I found these regexes (stackoverflow (dot) com/questions/2113908/what-regular-expression-will-match-valid-international-phone-numbers), but they're all too specific. The regexes are each for very specific environments. Some can take anything from 3 to 14 numbers, others need a + and don't take into account spaces and parentheses, etc.
I also found a url scraper (scrapebox (dot) com/phone-number-scraper). But it is only for urls and is really not adaptive or API-like.
I come here because you'll probably deal with these scenarios more often. Does anyone know of solutions to this problem?
The problem is that the texts also contain other numbers (amounts and counts, various IDs). I can take some margin of error, and it shouldn't matter whether they have the country code or if the country code is preceded by 00 or +.
They can also have parentheses, spaces, hyphens. I've found a few that take very specific formats. I could make a compilation of those.
I found these regexes (stackoverflow (dot) com/questions/2113908/what-regular-expression-will-match-valid-international-phone-numbers), but they're all too specific. The regexes are each for very specific environments. Some can take anything from 3 to 14 numbers, others need a + and don't take into account spaces and parentheses, etc.
I also found a url scraper (scrapebox (dot) com/phone-number-scraper). But it is only for urls and is really not adaptive or API-like.
I come here because you'll probably deal with these scenarios more often. Does anyone know of solutions to this problem?