Phone number too long, How to edit? (replace numbers with nothing)

Hi,
I have a list of phone numbers.
Some are missing ZERO, so I fix it with template:
X111111111
And some has too many numbers:
972111111111
I would like to get rid of the 972 at the beginning.
I tried do it with template but couldn’t figure out how,

What do you suggest?
Thanks.

^972(\d+)

3 Likes

Is there a pattern to the corrections you would like to make?

If so, you could for instance use the Slice Text column to remove + symbols in front of phone numbers. Or use the Remove All column to remove spaces or hyphens inside a phone number.

On the one hand I’m not crazy about regex because to me it’s a form of code, on the other I dislike reinventing the wheel. And phone number validation is no wheel. Phone number validation has been solve a billion times before, it bothers me to even have to think about it. So regular expression might come in handy.

Darren’s regex is making me dread the day I will need to start writing them. Past this short moment of dread, I wouldn’t be surprised if there are regex builders that allow us to build regular expressions without knowing regex syntax? Maybe Chad is good at regex ? (Chad is short for ChatGPT, that’s what I call him).

1 Like


Text Slice
Start 3

1 Like

And that’s only a starter level regex. I really do hope you don’t need to dive into them.

Back in the day, I used to write quite a lot of regex. I was just having a fossick around in some of my old repos and found a few examples:

Extracts the model number, version and serial number from an SNMP Sysdesc string for an Orinoco Wifi device:

(/(AP-[0-9]+)\s*?(v[\w\.\(\)]+)\s+(SN-\w+)/)

The same, except for Lucent devices:

(/(WavePOINT\-\w+)\s+(V[\d\.]+)\s+(SN\-\w+)/)

Writing regex can fry your brain, but it can also be weirdly satisfying :slight_smile:

2 Likes