Closed vesper8 closed 4 years ago
thanks for the quick reply. I'm giving this a try and the first problem I see is that the region argument is not optional. You have to pass a region code but I don't know what that code should be, I guess I could iterate over every possible region code trying to find a match but that would be too expensive.
Also, once you do get a match, there doesn't seem to be a way to verify that? Like you can loop
foreach($phoneNumberMatcher as $match) {
dd($match);
}
But there is no way to do something like
if(count($phoneNumberMatcher->matches())) {}
or
$phoneNumberMatcher->hasMatches()
In my case, I am not interested in the actual numbers and their details, rather I want to know if the text contains anything that looks like a phone number
Any idea on how I could achieve this with this library?
Did you try just count($phoneNumberMatcher)
?
Closing due to inactivity.
If you have any further questions, feel free to re-open the issue.
This is what I'm looking for, I have large swats of random text (user messages) and I want to detect if any of them contain valid phone numbers.. the numbers come an assortment of formats and countries