title: Why does checking this string with Regex.IsMatch cause CPU to reach 100%?
body: <p>When using <code>Regex.IsMatch</code> (C#, .Net 4.5) on a specific string, the CPU reaches 100%.</p>
  
  <p>String:     </p>
  
  <pre><code>https://www.facebook.com/CashKingPirates/photos/a.197028616990372.62904.196982426994991/1186500984709792/?type=1&amp;permPage=1
  </code></pre>
  
  <p>Pattern:</p>
  
  <pre><code>^http(s)?://([\w-]+.)+[\w-]+(/[\w- ./?%&amp;=])?$
  </code></pre>
  
  <p>Full code:</p>
  
  <pre><code>Regex.IsMatch("https://www.facebook.com/CashKingPirates/photos/a.197028616990372.62904.196982426994991/1186500984709792/?type=1&amp;permPage=1",
                  @"^http(s)?://([\w-]+.)+[\w-]+(/[\w- ./?%&amp;=])?$");
  </code></pre>
  
  <p>I found that redacting the URL prevents this problem. Redacted URL: </p>
  
  <pre><code>https://www.facebook.com/CashKingPirates/photos/a.197028616990372.62904.196982426994991/1186500984709792
  </code></pre>
  
  <p>But still very interested in understanding what causes this.</p>