title: How to check the matched character has spaces around in string when replacing it
body: <p>I have to replace all '&amp;' with 'and' but if string will like this 'Black&amp;air' how I can replace it smartly if '&amp;' has space around then it will only replace with 'and' and if it has no spaces around then ' and '.</p>
  <p>Initially i replacing all '&amp;' with 'and'</p>
  <pre><code>value.replace(/&amp;/gi, 'and')
  </code></pre>