Unlike e-mail's (for which there is even a built-in parser), phones are much more difficult to parse, because for them there is no universally accepted recording format and, accordingly, it will not be possible to write a regular expression that universally collects phones.
Usually, to collect phones, parsers are written for a specific resource (site). Or, if you need phones of only one country, you can bind to the phone code.
In general, the principle of operation is the same as for collecting any other data: you get the source code of the page (for example, via Net::HTTP) and collect numbers from it using a regular expression.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.