I have to extract phone numbers from free form of texts.
How can I manage it by using reg-ex in python?
I have found for one in order to extract e-mail addre
You have to build a pattern to be able to match it with regexp. The question is what is the format you are looking for?
To be able to do this you should do some research on the use-cases how the phone numbers show up.
So I'd expect you to define what are you meaning by matching phone numbers.
I just mean that there is a huge difference between: - I want to match phone numbers from a text that can be from any country, mobile or landline, in any format, with random spaces and (,) chars in it or - I want to match phone numbers from Hungary, with a +xx(space)xxxxxxx(space) format, that is always consistent.
Summary: To be able to build a pattern with regexp and use it to match all the phone numbers in your text, you have to be aware of the different representations, meaning what are you expecting a phone number will look like. If your pattern is not correct, you might miss a lot of phone numbers.
Hope this code serves a good cause, V