SQL Server 2014 replace with regex
<p>What is the best way to replace string in column like:</p>

<p>Let's say I have table with column type <code>varchar</code> and with the possible value that contains: </p>

<pre><code>'sample text min(my value) continue with sample text with ) and ('
</code></pre>

<p><strong>Note</strong>: my value can vary.</p>

<p>Now I would like to replace it with:</p>

<pre><code>min(max(my value))
</code></pre>

<p>so that the final value would in that case be:</p>

<pre><code>'sample text min(max(my value)) continue with sample text with ) and ('
</code></pre>

<p>I would like to perform update on the whole table.</p>

<p>Is it possible using pure T-SQL?</p>

<p>So two sample rows before => and after transformation:</p>

<pre><code>1. the value is: min(10). =&gt; the value is: min(max(10))
2. sample min(cat) =&gt; sample min(max(cat)) 
</code></pre>

<p>Basically replace all occurrences of <code>min(value)</code> with <code>min(max(value))</code> where <code>'value'</code> can be any string</p>