Are there best practices for validating, recording AND formatting phone numbers?  Thanks for the link to AN answer regarding AN ELEMENT of my question: a regex for validating.  But please recognize that it does not answer the question that was asked.  There are no doubt countless suggestions for validating, recording and formatting phone numbers; many of which are highly rated.  However, since this is a common area that a multitude of developers have wrestled with for a long period of time, I asked if there are generally accepted best practices for the whole package.    Please read and respond to the stated question:  Are there best practices for validating, recording and formatting phone numbers?     Starting with the data element, are phone numbers better stored as integers or strings (or something else)? Next, should delimiters be stored with the numbers or stripped out? (In other words, should (212) 555-1212 be recorded as 2125551212 and  then formatted appropriately in a view?) Next, what's the best way to deal with formatting alternatives in different countries?  Perhaps if the country code was recorded in a separate field, a SWITCH statement could be used to select the right formatting for the view (or validation) of the phone number itself. Finally, are there good examples of regular expressions or other methods for validating phone number inputs?   I recognize the this is really a collection of questions, each of which likely has opinions scattered all over SO and the web.  Since validating, recording and displaying formatted phone numbers is such a common task, it seems like there should be some standard methodologies or best practices; and my question is, "Are there generally accepted practices, and where can I find them?"
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.
What is the number of automorphisms (including identity) for permutation group $S_3$ on 3 letters? How do I give myself an item that can only be placed on a block with a certain damage value? What Happens to electrons after Alpha Decay and Nuclear Fission? I have a COM dll written in vb6. When I try to create a new object of a class module from this dll I get a Run timer error 430: Class does not support automation or does not support expected interface. The interesting thing is that this happens only from outside the IDE, when I am debugging from within the IDE there is no error thrown and the new object of the class is created successfully. What can be the cause?  In general I occasionally get these kind of errors in COM dlls. What is the best way to debug COM issues? How can I know the path of the dll that is being used when a program is running? Finding the perimeter of a right triangle with area given Allow moderators to see delete/undelete activity on users' profiles We get auto flags for 'possible vandalism' related to deletes, and these can be helpful at times in finding 'rage quit' users, or other potential problems.  But often, I would like to know if there is a prior pattern with the user doing this. While we can see posts of theirs which have been flagged, and perhaps find previous auto flags this way, it would be nice to see an overall view of their self-deletions and undeletions; mostly just to identify patterns.  Such a feature would be nice if it was activity centered, rather than post-centered. That is; each delete/undelete action should be shown. So we could easily see, for example, if someone went back-and-forth on a single post.  The "activity" tab in the profile would be a logical place to show these events.  I think this would be best to be limited to instant self-deletions, not deletion votes. Why use a dedicated light meter instead of the one built into the camera? I am asked to complete my withdrawal transaction with COT fee of 1200 dollars I was marketed by a lady online on some investment packages in bitcoin. ($200 to become $2500 in one week of trade). I indicated interest in this. She took me to a trading website to sign up.  I deposited $200 at the start. After trading for 2 days with earnings, they called me to upgrade the account with $450 which I did. They then traded for 1 week and the account balance became $6786.    I requested to withdraw $6000 from my account and they told me to bring a COT fee of $1200 to complete my withdrawal.  Please help me do a background check on them. Are they real or fake? Check the registration of the company if it is real. The marketer told me the company will pay her from the COT fee. What are the “spam” and “rude or abusive” (offensive) flags, and how do they work? How does ${!#} work in bash to get the last command-line argument? From the Advanced Bash-Scripting Guide, to get the last command-line argument:     Or: lastarg=${!#}    This is an   indirect reference to the $# variable.    Note that lastarg=${!$#} doesn't work. I thought people would be working on little code projects together, but I don't see them, so here's an easy one:  Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to use weak validation.  I wrote a little bit about zip codes in a side project on my wiki/blog:    There is also a new, weird type of zip code.     I can do the javascript code, but it would be interesting to see how many languages we can get here. I was making a scene in blender and I wanted to change the texture from "Material_1" to "Material_2". It lets me change it but when I go to rendered view the part looks the same. can someone please help me Why does no line appear when using Interpolate Line in ArcMap? The nose of Tom Riddle (as a student) was fine, as I have seen in the movies. But, Voldemort's nose doesn't look like a normal human nose. What really happened? When rolling percentages, do 1d100 and two d10s (percentiles) share the same probabilities? Add folder name to beginning of filename Methods to work around the problem of missing data in machine learning How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?  SELECT * FROM Tags  WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC   In this query, the number of arguments could be anywhere from 1 to 5.  I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that. Join table depending on value of column in main table How can I generate isometric sprite sheets from 3D animations?