Title: Regex Validation Euro Phone Numbers
Tags: regex
Question: I currently use a regex phone validation for US which works great for (xxx) xxx-xxxx:
((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}
I am trying to get the same type of validation like this for European land and cell numbers for the following two formats but cant seem to make it work:
(xxxx-xxxxxx) and (xxxx) xxxxxx
Comment: This question appears to be off-topic because OP should show their attempts and explain what went wrong.

Comment: What makes you think that's the format of European numbers? Certainly neither my landline nor mobile numbers here in England follow that format!

Comment: I live in the UK. My landline number is in the format: (xxxxx) xxxxxx. This is the most common format for landlines in the country, and you haven't even considered it. Long story short, don't even try to generalise a rule... There are WAY too many possibilities!

Comment: There's only one general rule about phone numbers: There are digits in it, letters and special chars are less frequent.

Here is the accepted answer: In a word, forget it: The number of digits vary per country, as does the format.
You cannot even count on the format or the number of digits to be consistent within the same country: while major carriers have a single digit prefix, many smaller ones have two or three. Also, depending who writes it down, they may include the country code without the leading zero, or the country code along with the leading zero, or the leading zero without a country code. With parentheses, or spaces, or dashes, or all of the latter.
And let's not forget institutions with numbers like 800-CALL-US, corporate numbers with phone extensions, etc.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:07/03/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<regex>', 'Title': 'Regex Validation Euro Phone Numbers', 'ViewCount': 156, 'id': 17452219, 'user_AboutMe': None, 'user_AccountId': 417151.0, 'user_DisplayName': 'the sandman', 'user_Reputation': 1019.0, 'user_Views': 97.0, 'user_id': 792981.0}}