title: How can I replace text, such as quotes or tags, in pairs?
body: <p>I would like to convert the text <code>&lt;b&gt;^FTest&lt;/b&gt;</code> to <code>&lt;div class="import"&gt;FTest&lt;/div&gt;</code>, such that the end tag will only be matched and replaced if the start tag was also matched and replaced.</p>
  
  <p>For a simpler analogy: how can I easily switch between the following:</p>
  
  <pre><code>This is a "simple" test, yes, a "simple" test, that's right a "simple" test.
  This is a [simple] test, yes, a [simple] test, that's right a [simple] test.
  This is a **simple** test, yes, a **simple** test, that's right a **simple** test.
  This is a &lt;b&gt;simple&lt;/b&gt; test, yes a &lt;b&gt;simple&lt;/b&gt; test, that's right a &lt;b&gt;simple&lt;/b&gt; test.
  </code></pre>