title: Regex to match all us phone number formats
body: <p>First of all i would say i have seen many example here and googled but none found that matches all the condition i am looking for some match top 3 not below some inbetween.
  Kindly let me know how to put all of them in one place.</p>
  
  <pre><code>(xxx)xxxxxxx
  (xxx) xxxxxxx
  (xxx)xxx-xxxx
  (xxx) xxx-xxxx
  xxxxxxxxxx
  xxx-xxx-xxxxx
  </code></pre>
  
  <p>Using as :</p>
  
  <pre><code>  const string MatchPhonePattern =
             @"\(?\d{3}\)?-? *\d{3}-? *-?\d{4}";
              Regex rx = new Regex(MatchPhonePattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
              // Find matches.
              MatchCollection matches = rx.Matches(text);
              // Report the number of matches found.
              int noOfMatches = matches.Count;
              // Report on each match.
  
              foreach (Match match in matches)
              {
  
                  tempPhoneNumbers= match.Value.ToString(); ;
  
               }
  </code></pre>
  
  <p>SAMPLE OUTPUT:</p>
  
  <pre><code>3087774825
  (281)388-0388
  (281)388-0300
  (979) 778-0978
  (281)934-2479
  (281)934-2447
  (979)826-3273
  (979)826-3255
  1334714149
  (281)356-2530
  (281)356-5264
  (936)825-2081
  (832)595-9500
  (832)595-9501
  281-342-2452
  1334431660
  </code></pre>