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
This is the regular expression you want:
/(#[a-z0-9][a-z0-9\-_]*)/ig
The i makes it case insensitive, which you already had. But the g makes it look through the whole string ("g" stands for "global"). Without the g, the matching stops at the first match.
This also includes a fix to remove the incorrect parenthesis and some unneeded backslashes.