title: .net equivalent for php preg_replace
body: <p>What is the c#.net equivalent for php's preg_replace function?</p>
  
  <p>php code is like this:</p>
  
  <pre><code>    const ALLOW_VALUES = '[^a-z0-9àáâäèéêëìíîïòóôöùûŵýÿyÁÂÄÈÉÊËÌÎÏÒÓÔÖÙÛÜŴYÝ]';
  
      public function streetTownHash($data, $hashCheck = false, $updateRecord = false)
       {
         foreach($data as $key=&gt;$value){
          try{
           $value = mb_convert_case($value, MB_CASE_LOWER, "UTF-8");
           } catch(Exception $e) {
            echo "Requires extension=php_mbstring.dll enabled !  - $e";
           }
          $valueConcat .= preg_replace('/'.self::ALLOW_VALUES.'/','',$value); # Remove punctuation etc
         }
         $streetTownHash =  sha1($valueConcat);
  
  ....
  </code></pre>
  
  <p>Edit: now is like so.</p>
  
  <pre><code>    private readonly SHA1 hash = SHA1.Create();
      private readonly Regex PunctuationStripper = new Regex(@"[^a-z0-9àáâäèéêëìíîïòóôöùûŵýÿyÁÂÄÈÉÊËÌÎÏÒÓÔÖÙÛÜŴYÝ]", RegexOptions.IgnoreCase);
      public string HashString(string value)
      {
          value = value.ToLower();
          value = PunctuationStripper.Replace(value, string.Empty);
          var bytes = ASCIIEncoding.UTF8.GetBytes(value);
          var hashed = hash.ComputeHash(bytes);
          return ASCIIEncoding.UTF8.GetString(hashed);
      }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Would the regex expression need to change also? </p>