title: C# regular expression to match ANY character?
body: <p>In C#, I write the following string to a string variable, carriage return and all:</p>
  
  <pre><code>asdfasdfasdf
  asdfas&lt;test&gt;asdfasdf
  
  asdfasdf&lt;test&gt;asdfasdf
  </code></pre>
  
  <p>In Notepad2, I use this regular expression:</p>
  
  <pre><code>&lt;test&gt;.*&lt;test&gt;
  </code></pre>
  
  <p>It selects this text as expected:</p>
  
  <pre><code>&lt;test&gt;asdfasdf
  
  asdfasdf&lt;test&gt;
  </code></pre>
  
  <p>However, when I do this in C#:</p>
  
  <pre><code>System.Text.RegularExpressions.Regex.Replace(s, "&lt;test&gt;.*&lt;test&gt;", string.Empty);
  </code></pre>
  
  <p>It doesn't remove the string.  However, when I run this code on a string without any carriage returns, it does work.</p>
  
  <p>So what I am looking for is a regex that will match ANY character, regardless whether or not it is a control code or a regular character.</p>