You might look into enabling the Akismet add-in (free at https://akismet.com/), which is pretty effective in blocking common comment spam.
There are many comment spam blockers available as plugins; including my own 'FormSpammerTrap'. All (including mine; found in the repository to reduce self-promotion) have various levels of success, you will need to try them to see which one works best for you.
There are also settings in Settings, Discussion that will allow you to approve all comments from new commenters.
You could write your own code that would look for specific text, but that would not be efficient...all it would take is for the spammer to make a slight change to their text and your code wouldn't catch it.
Using Akismet will catch common spammers, but no solution will catch all of the spammers. What one hopes is that the spam-catchers will catch most of the comment spam, leaving only a few for you to remove manually.
You can also add captchas to your comment form, but those are not very user-friendly, and can be defeated. Hidden fields are easily sensed by the spam-bot, and questions ('what is 3+6?') is also not effective. Even my techinique (watching for focus/click on required fields) can be defeated by non-automated spammers.
What you are looking for is something that will catch most of the spam comments. But you will never find a complete/catch-everything solution. The best you can hope for is something that catches most of them.