<p>What is the PHP preg_replace in C#?</p>

<p>I have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace("old","new").</p>

<pre><code>$patterns[0] = '/=C0/';
$patterns[1] = '/=E9/';
$patterns[2] = '/=C9/';


$replacements[0] = 'à';
$replacements[1] = 'é';
$replacements[2] = 'é';
return preg_replace($patterns, $replacements, $text);
</code></pre>

You are looking for
```
System.Text.RegularExpressions
```
;
```
```
using System.Text.RegularExpressions;

Regex r = new Regex("=C0");
string output = r.Replace(text);
```
```
To get PHP's array behaviour the way you have you need multiple instances of `Regex
However, in your example, you'd be much better served by .Replace(old, new), it's much faster than compiling state machines.