I would like to get the phone numbers from a file. I know the numbers have different forms, I can handle for a single one, but don\'t know how to get a uniform regex. For ex
grep -oE '\(?\<[0-9]{3}[-) ]?[0-9]{3}[ -]?[0-9]{4}\>'
Matches all your formats.
The \< and \> word boundaries prevent matching numbers that are too long, such as 123-123-12345 or 1234-123-1234
\<
\>
123-123-12345
1234-123-1234