Very simple, I need to match the #
symbol using a regex. I\'m working on a hashtag detector.
I\'ve tried searching in google and in stack overflow. One
#
does not have any special meaning in a regex, unless you use it as the delimiter. So just put it straight in and it should work.
Note that \b
detects a word boundary, and in #abc
, the word boundary is after the #
and before the abc
. Therefore, you need to use the \b
is superfluous and you just need #\w\w+
.