How can I search some text for any and all hashtags (alphanumeric AND underscore AND hyphen) and wrap them in span tags eg search
some_string = \"this is so
Try this replace call:
EDIT: if you want to skip http://site.com/#tag kind of strings then use:
http://site.com/#tag
var repl = some_string.replace(/(^|\W)(#[a-z\d][\w-]*)/ig, '$1$2');