title: Replacing substring in a numeric pattern
body: <p>I have a string </p>
  
  <pre><code>text *inner text 1* text2 *inner text 2*
  </code></pre>
  
  <p>I have to replace the substrings with <code>&lt;span&gt;&lt;/span&gt;</code></p>
  
  <p>Output</p>
  
  <pre><code>text &lt;span&gt;inner text 1&lt;/span&gt; text2 &lt;span&gt;inner text 2&lt;/span&gt;
  </code></pre>
  
  <p>I tried this</p>
  
  <pre><code>replace(/[*]/g,"&lt;span&gt;")
  </code></pre>
  
  <p>I know using /g is going to replace all the occurrences with <code>&lt;span&gt;</code> also I cannot put two params in replace so the question is how to replace <strong>every even occurrences</strong> with <code>&lt;/span&gt;</code></p>