Monday, 6 March 2017

regex - Regular Expression for finding phone numbers


Possible Duplicates:
A comprehensive regex for phone number validation
grep with regex for phone number






Hello Everyone,



I am new to Stackoverflow and I have a quick question. Let's assume we are given a large number of HTML files (large as in theoretically infinite). How can I use Regular Expressions to extract the list of Phone Numbers from all those files?




Explanation/expression will be really appreciated. The Phone numbers can be any of the following formats:




  • (123) 456 7899

  • (123).456.7899

  • (123)-456-7899

  • 123-456-7899

  • 123 456 7899

  • 1234567899




Thanks a lot for all your help and have a good one!

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...