title: RegExp range out of order with complex pattern
body: <p>This is my pattern:</p>
  
  <pre><code>var pattern = "/(?:https?:\/\/)?(?:www\.)?facebook\.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[\w\-]*\/)*([\w\-\.]*)/";
  var matches = $("#search input").val().match(new RegExp(pattern));
  </code></pre>
  
  <p>When I use it, it gives me an error:</p>
  
  <pre><code>Uncaught SyntaxError: Invalid regular expression: //(?:https?://)?(?:www.)?facebook.com/(?:(?:w)*#!/)?(?:pages/)?(?:[w-]*/)*([w-.]*)//: Range out of order in character class
  </code></pre>
  
  <p>From reading on another similar issues it came to my attention that I need to double escape some characters, but I don't know which out of all from my pattern.</p>