DEV Community

Samuel Suther
Samuel Suther

Posted on

Regular Expression to find hastag-cloud at the end of an message

Alt Text

I do support a Project named Facebook Newsbeamer, which do fetch your messages from your Facebook-Thread (via FB-API) and show in your News-Section at your Homepage.

As you might know, you can use hashtags (like #myHastag) in Facebook to make people easily find your post.
Some people do insert their hashtags right in the content, other ones put them all at the bottom of the message to provide a better readability of the message.

I do call those "all hastags at the bottom of the message" - hastag-cloud.

As we don't need the hashtag-cloud in our Newsboard at our Website, we decide to locate them, and cut them of.

How I did it

And here is how I did it.
We do fetch the messages via PHP ⇒ FB-API. So I've created a Regular-Expression which does the job!

https://regexr.com/62fbp

So as this might also be usefull for other ones, I do share it here.
Feel free to use and share it for free.

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more