Use regex backreference inside character except class [^] : <p>Lets take:</p>

<p><code>stringi = 'xnxx xnnx xnnxn'</code></p>

<p>My regex is: <code>(n)[^n]</code></p>

<p>I want to make my regex a little more dynamic like that:</p>

<p><code>(n)[^\1]</code>  -<code>\1</code> beeing the capt. grp 1</p>

<p>My desired result would be that:</p>

<ul>
<li><code>(n)[^\1]</code> would be equal <code>(n)[^n]</code></li>
<li><code>(x)[^\1]</code> would be equal <code>(x)[^x]</code></li>
</ul>

<p>How can I not match a <code>NOT-\1</code> character?</p>
