I found this code in some website, and it works perfectly. It validates that the phone number is in one of these formats: (123) 456-7890 or 123-
Just wanted to add a solution specifically for selecting non-local phone numbers(800 and 900 types).
(\+?1[-.(\s]?|\()?(900|8(0|4|5|6|7|8)\3+)[)\s]?[-.\s]?\d{3}[-.\s]?\d{4}