I want to use regular expressions to search for a line consisting of one single word. Say the word was apple, and I am searching:
apple
banana
apple pear banana
apple banana
pear apple
pear
I only want it to match "apple". I do not want to match apple just at the beginning of the line, but when the line is equal to "apple".
Edit: for those asking why I'm using regular expressions, I need to check for the word case-insensitively, thus I'm using (?i)apple
Edit2: I'm modifying the title to reflect that this can be used not just for a specific word, but anytime we are looking for the entire contents of a line, rather than just matching lines that contain the expression