in reply to phone number regex
It sounds like you might have more than one number per line, so you'd want to use the //g flag to get more than one match. Your regex should capture the whole numbers with | to alternate between the different patterns, and strip out the extra characters afterward. Then format it as xxx-xxxx or xxx-xxx-xxxx depending on how long it is.
|
|---|