How to strip a phone number

magicuser68

Member
Licensed User
Longtime User
I looked through the forums a couple times and I couldn't find any simple code to strip a phone number. I know there is a lot of regex stuff that I read about but I just can't figure it out on my own.

Can someone write a function that returns a 10 digit number from the examples below?

Examples:

1 (333) 333-3333
333-333-3333
(333) 333-3333
333 333 3333

Thanks in advance
 
Top