title: Knockout-Validation Using Regular Expression to Validate a Phone Number
body: <p>I am trying to add a simple regular expression validation to one of my observables using Knockout-Validation.</p>
  
  <p>I have the following:</p>
  
  <pre><code>self.ContactPhone = ko.observable().extend({
              required: true,
              pattern: {
                  message: 'Invalid phone number.',
                  params: '^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$'
              }
          });
  </code></pre>
  
  <p>However, no matter what I enter, it returns the message 'Invalid phone number.' Is there a certain way I need to format the expression? I've tested it using purely JavaScript and it works fine.</p>