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
You don't need to escape it (it's probably the \b that's throwing it off):
\b
if (preg_match('/^\w+#(\w+)/', 'abc#def', $matches)) { print_r($matches); } /* output of $matches: Array ( [0] => abc#def [1] => def ) */