function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marty Y. ChangMarty Y. Chang 

how to get the set of hashtags used in a Chatter post/comment

Does anyone know how to get a Set<String> of all hashtags used in a Chatter post or comment?

Best Answer chosen by Admin (Salesforce Developers) 
Marty Y. ChangMarty Y. Chang

This expression seems to work for me:

Pattern hashtagPattern = Pattern.compile('\\B#[a-zA-Z][a-zA-Z0-9]+');