title: JS Replacing whole word with regex
body: <p>Alright so I am trying to check if string contains @, if so it should delete the entire word that is part of that @</p>
  
  <p>For example, lets say that string says '@someone' it should replace entire '@someone' with for example 'Hello'. </p>
  
  <p>My current code just replaces the @ sign and not the entire word</p>
  
  <pre><code>$(document).on('click', '.mention_each_data', function() {
      var format = "@" + $(this).find('p').text();
      element_moderated.val(element_moderated.val().replace(/(\s*)@\b/g, format));
  });
  </code></pre>