title: Angular2 form validation check for number
body: <p>I am having a problem verifing the the password entered in my angular 2 form contains at least one number in it. The other validators work its just this pattern one. the regex I am using I got from 
  <a href="https://stackoverflow.com/questions/3180354/regex-check-if-string-contains-at-least-one-digit">Regex: Check if string contains at least one digit</a>
      <p>
           Password:
           
      </p></p>
  
  <pre><code>&lt;div *ngIf="signUpForm.controls['password'].invalid &amp;&amp; signUpForm.controls['password'].dirty"&gt;
        &lt;small *ngIf="signUpForm.controls['password'].errors.minlength"&gt;
                              Please enter a minimum of 6 characters
                          &lt;/small&gt;
        &lt;small *ngIf="signUpForm.controls['password'].errors.maxlength"&gt;
                              Password cannot exceed 15 characters
                          &lt;/small&gt;
        &lt;small *ngIf="signUpForm.controls['password'].errors.pattern"&gt;
                              Must contain digits
                          &lt;/small&gt; 
   &lt;/div&gt;
  </code></pre>
  
  <p>inside my form I have the following validator and specifically the pattern I want is to check if the string entered contains a number </p>
  
  <pre><code>"password":["", [
                 Validators.required,
                 Validators.minLength(6),
                 Validators.maxLength(15),
                 Validators.pattern('/\d')
             ]
         ]
  </code></pre>
  
  <p>The errors.patters ngIf never goes away even if there are numbers in the field, not sure what I am doing wrong. My other pattern validators for other fields work. </p>