title: Combine regular expression together in OR?
body: <p>I'm testing if <code>input class="k"</code> contains valid characters for the <strong>HTML ID</strong> attribute, showing an <code>alert</code> if not:</p>
  
  <blockquote>
    <p>ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
    followed by any number of letters, digits ([0-9]), hyphens ("-"),
    underscores ("_"), colons (":"), and periods (".").</p>
  </blockquote>
  
  <p>I'd like to combine both regular expression in logical OR. <strong>Is there a way to combine them in a single regex?</strong></p>
  
  <pre><code>$('.k').keyup(function(){
     if((/^[\d]/).test($(this).val())) alert('Not valid!');
     if((/[\s]/).test($(this).val()))  alert('Not valid!');
  });
  </code></pre>