title: replacing specific characters in between specific elements
body: <p>I'd like to use a regular expression to replace a space in a string. The space in question is the only space between two elements in the string. The string itself however contains much more elements and spaces. So far i've tried</p>
  
  <pre><code>(&lt;-)[\s]*?(-&gt;)
  </code></pre>
  
  <p>But that doesnt work. It is supposed to take </p>
  
  <p>&lt;-word anotherword-></p>
  
  <p>and allow me to replace the space in it. </p>
  
  <p>As \s selects all spaces, and</p>
  
  <pre><code>(&lt;-)[\s\S]*?(-&gt;)
  </code></pre>
  
  <p>Selects all characters inbetween the &lt;- and ->, i tried to re-use the expression but then for the spaces only.</p>
  
  <p>I'm not so good at these expressions, and i can't for the life of me find an answer anywhere. </p>
  
  <p>If anyone could just point me to the answer, that would be great. Thanks.</p>