How to get data from Clipboard, then replace based on what is in it ?

I'm making a software similar to Grammarly in C++. I want to get data from the clipboard, then if a certain sequence of data that is a certain number of letters is contained in it, then it has to be replaced by a predefined string.