title: regEx.test(string) does not work in IE but works fine in Chrome, Safari, FireFox
body: <p>I'm loading content via JSON/JSONP from another (parent) site and displaying it locally. The following function hijacks link click events, checks to see if the link points to the parent site, strips the parent site URL from the link, and runs a function to load a news article based on the link URL.</p>
  
  <p>This works fine in all but IE. The issue is with this line:</p>
  
  <pre><code>if(regex.test(href)) {
  </code></pre>
  
  <p>If I comment that out, everything works just fine. However, that conditional check is necessary to ensure that we don't hijack links to external sites, i.e., nytimes.com.</p>
  
  <p>I'm stuck as to how to proceed here and am unable to figure out whether this is actually an IE bug or if there's a problem with the regex, or perhaps with how the HREF is being collected? Any insight would be helpful. Full function below.</p>
  
  <pre><code>function hijackURLs() {
      // hijack link click events
      $("#news-archive, #news-story").on("click", "a", function(evt) {
  
          var regex = /http:\/\/parent-site.com\//
              , href = $(this).attr("href");
  
          // make sure the link matches our regex
          // this isn't working in IE for some reason
          if(regex.test(href)) {
  
              evt.preventDefault();
  
              // replace the href with hashtag
              href = href.replace( regex, '#' ).split( '\/#more-' )[0];
  
              // change the url without a page refresh and add a history entry.
              history.pushState(null, null, href);
  
              // load the content
              showArticle( href, _news );
  
          }
      });
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> I'm rephrasing here. The line mentioned above does not throw an error in IE; it just does not work in IE. The href does not pass the regex.test(), thus the string does not get replaced, and the function to load the article content in place does not get called.</p>