仅匹配#hashtags 的正则表达式是什么?

what is the regex for matching only #hashtags?

我正在开发一个社交网络应用程序,它具有散列标签功能。我想匹配所有 #tags 但不匹配 #[[123:hashTag:rameez]] 。我分别知道两者的正则表达式我怎么能在一个正则表达式中做到这一点?

这是一个例子:

$tweet = "this has a #hashtag a  #badhash-tag and a #goodhash_tag";

preg_match_all("/(#\w+)/", $tweet, $matches);

var_dump( $matches );