title: Regular expression for fax number validation in a JavaScript registration form
body: <p>I am a complete newbie when it comes to regular expressions. Even after reading guides about them, I still have a hard time formulating my own. I am trying to get my form to validate the fax number in the +12345678910 format. I have some code, but it allows me to submit mixed numbers and letters, as well as submit data with blank spaces and without filling out the faxnum text box completely. I would strongly appreciate any help with the form and tips on how to become more proficient with regex.</p>
  
  <pre><code>var fax = document.registration.faxnum; 
  faxval(fax);
  
  function faxval(fax)
  {
      var numbers = /[\+? *[1-9]+]?[0-9 ]+/; //Bad regex
      if (fax.value.match(numbers))
      {
          document.getElementById("faxmsg").innerHTML=("Everything is OK.");
          faxmsg.style.color="green";
      }
      else
      {
          faxmsg.innerHTML=("Invalid fax number.");
          faxmsg.style.color="red";
      }
  };
  </code></pre>