title: Replacing strings between | | with RegEx using JavaScript
body: <p>I am fetching some data from an API. One of the results is this string:</p>
  <p>| Experience Points | Level | Proficiency Bonus |</p>
  <p>I've been trying to use RegEx with replace() to have each string between | | in a  tag. So far I was able to have the first and last inside the tag, but I fail to have the middle string inside the tag. Can someone point out what I am doing wrong and maybe help me with a solution? I've been stuck on this for days. I'd really appreciate it.</p>
  <p>This is what I have done so far:</p>
  <pre><code>replace(/\|\s(\D*?)\|/g, &quot;&lt;span&gt;$1&lt;/span&gt;&quot;)
  </code></pre>
  <p>It gives me the following result:</p>
  <pre><code>&lt;span&gt; Experience Points &lt;/span&gt; Level &lt;span&gt; Proficiency Bonus &lt;/span&gt;
  </code></pre>
  <p>This is what I expect:</p>
  <pre><code>&lt;span&gt; Experience Points &lt;/span&gt; &lt;span&gt; Level &lt;/span&gt; &lt;span&gt; Proficiency Bonus &lt;/span&gt;
  </code></pre>
  <p>Thank you all for the help.</p>