title: How to validate a (country specific) phone number
body: <p>A valid phone number contains:</p>
  <ul>
  <li>Less than 9 characters</li>
  <li>A &quot;+&quot; at the start</li>
  <li>Only digits.</li>
  </ul>
  <p>I'm trying to use regular expressions but I've only started using them and I'm not good at it. The code I have so far is:</p>
  <pre><code>static void Main(string[] args)
  {
      Console.WriteLine(&quot;Enter a phone number.&quot;);
      string telNo = Console.ReadLine();
  
      if (Regex.Match(telNo, @&quot;^(\+[0-9])$&quot;).Success)
          Console.WriteLine(&quot;correctly entered&quot;);
  
      else
          Console.WriteLine(&quot;incorrectly entered&quot;);
  
      Console.ReadLine();
  }
  </code></pre>
  <p>But I don't know how to check the length of the string this way. Any help is appreciated.</p>