Passing Regex results to a function
<p>I am trying to replace the values in a string at run time based on the contents within a set of braces.</p>

<pre><code>// this.LinkUrl = "/accounts/{accountId}"
this.LinkUrl = Regex.Replace(account.Company.LinkUrl, @"\{(.*?)\}", "$1");
// this.LinkUrl = "/accounts/accountId"
</code></pre>

<p>So far it works as expected and removes the braces. But how can I pass the $1 value into a function, like so</p>

<pre><code>this.LinkUrl = Regex.Replace(account.Company.LinkUrl, @"\{(.*?)\}", this.GetValueForFieldNamed("$1"));
</code></pre>

<p>So that "accountid" is replaced with the value the function returns? e.g. "/accounts/56"</p>
