Detecting String in Specific Format

I was wondering if there was anyway to create a function that ‘detects’/finds a string in a specific format.

For example, when the function is run, anything following the format of “#text,” where ‘text’ could be anything, is found and identified. This means thing like “#hash” and “#tag”.

I have done research but failed to find anything useful.