title: Javascript RegExp in htaccess
body: <p>I have the following RegEx in Javascript:</p>
  
  <pre><code>    var re1 = '(~)';
      var re2 = '([a-z])';
      var re3 = '([a-z])';
      var re4 = '(\\d)';
      var re5 = '([a-z])';
      var re6 = '(\\d)';
      var matchExp  = new RegExp(re1 + re2 + re3 + re4 + re5 + re6, ["i"]);
      var match = window.location.href.match(matchExp);
      var shortcode = match == null ? "" : match[1];
  </code></pre>
  
  <p>What I am trying here is shortcodes, I want any url such as /~Xx0X0 to be redirected to /create.html.
  Where X/x is a non-whitespace character and 0 is a digit.</p>
  
  <p><strong>How would I use the Regex in .htaccess mod_rewrite?</strong>
  I hope that I explained it all correctly.</p>
  
  <p><strong>Shortcode Format</strong></p>
  
  <ul>
  <li><p>~</p>
  
  <p>Uppercase Character</p>
  
  <p>Lowercase Character</p>
  
  <p>Digit</p>
  
  <p>Uppercase Character</p>
  
  <p>Digit</p></li>
  </ul>