title: Javascript Regex match any word that starts with '#' in a string
body: <p>I'm very new at regex. I'm trying to match any word that starts with '#' in a string that contains no newlines (content was already split at newlines).</p>
  
  <p>Example (not working):</p>
  
  <pre><code>var string = "#iPhone should be able to compl#te and #delete items"
  var matches = string.match(/(?=[\s*#])\w+/g)
  // Want matches to contain [ 'iPhone', 'delete' ]
  </code></pre>
  
  <p>I am trying to match any instance of '#', and grab the thing right after it, so long as there is at least one letter, number, or symbol following it. A space or a newline should end the match. The '#' should either start the string or be preceded by spaces.</p>
  
  <p>This PHP solution seems good, but it uses a look backwards type of functionality that I don't know if JS regex has:
  <a href="https://stackoverflow.com/questions/11171305/regexp-keep-match-any-word-that-starts-with-a-certain-character">regexp keep/match any word that starts with a certain character</a></p>