title: JSF telephone numbers regular expression
body: <p>I'm using primefaces of JSF, I'm doing a regular expression checking for the input of phone number, accepted values are:</p>
  
  <p>909888
  +90877845</p>
  
  <p>here's my code</p>
  
  <pre><code>&lt;p:inputText validatorMessage="invalid value"&gt;
     &lt;f:validateRegex pattern="^[+]?[0-9]+$" /&gt;
  &lt;/p:inputText&gt;
  </code></pre>
  
  <p>My problem is that the expression does not pass the empty values, as the field is not required</p>