I am trying to build a regex pattern in Java to find a exact match of a word.
For example, the word hot should be found in the first 3 strings but not in th
hot
You can use word boundaries \b around your pattern. A word boundary does not consume any characters. It asserts that on one side there is a word character, and on the other side there is not.
\b
\bhot\b