title: Don't replace regex if it is enclosed by a character
body: <p>I would like to replace all strings that are enclosed by <code>-</code> into strings enclosed by <code>~</code>, but not if this string again is enclosed by <code>*</code>.</p>
  
  <p>As an example, this string...</p>
  
  <pre><code>The -quick- *brown -f-ox* jumps.
  </code></pre>
  
  <p>...should become...</p>
  
  <pre><code>The ~quick~ *brown -f-ox* jumps.
  </code></pre>
  
  <p>We see <code>-</code> is only replaced if it is <em>not</em> within <code>*&lt;here&gt;*</code>.</p>
  
  <p>My javascript-regex for now (which takes no care whether it is enclosed by <code>*</code> or not):</p>
  
  <pre><code>var message = source.replace(/-(.[^-]+?)-/g, "~$1~");
  </code></pre>
  
  <p>Edit: Note that it might be the case that there is an odd number of <code>*</code>s.</p>