Search for a whole word with grep in Linux

Let's suppose we have the following file:

$ cat examples.txt
grep examples
linux exam on 19th
If you try to search for word "exam":
$ grep exam examples.txt
grep examples
linux exam on 19th
both lines will be outputted.

To search for the lines that contain only the word "exam" - use -w option:
$ grep -w examples.txt
linux exam on 19th