I give up! I need a Regex to get just the area code and phone number but not the country code.
My data looks like this:
But it can also look like this:
I want to capture 7781234567
The first example is not a problem but the second example I just want to capture the rest of the phone number but not the “1”. And it is just “1” I want to get rid of. There are no other numbers in my data set that I want to remove from the front. And of course I want “1” if it is part of the phone number but not the country code. Plus there are no “-“ or spaces. My data looks exactly like I have it here. I promised I tried looking it up on the Internets but just could not find the right solution.
The only thing I can think of is trying to compare the beginnings of the phone numbers with a list like this one on wikipedia (maybe pared down specifically for your data set). But that can’t be done with a regex and without leading zeros it still might be impossible. Of course I don’t know the specifics of your country’s phone number system.