title: Why is this regex hanging with two trailing back-slashes but works fine with just one?
body: <p>I have the following code using regex that hangs at the last line when I run it:</p>
  
  <pre><code>const char PathSeparator = '\\';
  const string PathPrefix = "\\\\";
  
  var reg = new Regex(string.Format("^{0}(([^{1}\r\n\v\f\u2028\u2029]+){1}?)+$", 
      Regex.Escape(PathPrefix), Regex.Escape(PathSeparator.ToString())));
  
  var test = @"\\Inbox\Test123\Intermediate\3322FB69-FE3F-407E-9E15-584382A407A2\\";
  var matches = reg.Matches(test);
  var group = matches[0].Groups[2];
  </code></pre>
  
  <p>It works fine if I remove one of the final backslashes in <code>test</code>, e.g.</p>
  
  <pre><code>var test = @"\\Inbox\Test123\Intermediate\3322FB69-FE3F-407E-9E15-584382A407A2\";
  </code></pre>
  
  <p>Can someone please help me figure out why it's hanging?  I know I can set a timeout; that's not my question.</p>