<p>I have a regex call that I need help with.</p>

<p>I haven't posted my regex, because it is not relevant here.
What I want to be able to do is, during the Replace, I also want to modify the ${test} portion by doing a Html.Encode on the entire text that is effecting the regex.</p>

<p>Basically, wrap the entire text that is within the range of the regex with the bold tag, but also Html.Encode the text inbetween the bold tag.</p>

<pre><code>RegexOptions regexOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase;
text = Regex.Replace(text, regexBold, @"&lt;b&gt;${text}&lt;/b&gt;", regexOptions);
</code></pre>

Don't use Regex.Replace in this case...  use..
```
```
foreach(Match in Regex.Matches(...))
{
    //do your stuff here
}
```
```