如何使用PHP获取由哈希标记包围的匹配单词

I have something similar to this:

<a href="#action_link#" target="_blank">Token1</a><br>
<a href="##action_link##" target="_blank">Token1</a><br>

And I need to get only the one(s) that is/are surrounded by only one hashtag (#), for this sample I need only the first anchor tag.

I have tried also with grabbing the href attr to filter and make the regexp more easier with something like this:

preg_match_all('/<a\s[^>]*href=(\"??|\'??)(#action_link#?)[^>]*>/siU', $someHTML, $match);

But with no success :(

Could you please help me?

You can use:

preg_match('/\"\#(.*)\#\"/im', $string, $matches);
print_r($matches);

Where $string is your string to search