title: wrapping a matched regular expression of html page while preserving the original html structure
body: <p>it is hard to explain what I need in simple words, so I will put an example</p>
  
  <p>say I need to match my inner html with the string "be"</p>
  
  <p>original innerHTML is : <code>b&lt;/br&gt;e</code>
  expected new innerHTML is: <code>&lt;span&gt;b&lt;/br&gt;e&lt;/span&gt;</code>
  actual new innerHTML is: <code>&lt;span&gt;be&lt;/span&gt;</code></p>
  
  <p>what I do is I remove any html tag from my innerhtml so that my original html will be be, then I replace it with <code>&lt;span&gt;be&lt;/span&gt;</code>, </p>
  
  <p>now I am facing alot of problem preserving back the original html structure so that the results become <code>&lt;span&gt;b&lt;/br&gt;e&lt;/span&gt;</code></p>
  
  <p>thanks in advance</p>