Is it possible, using grep, to search for instances of
John Smith but exclude instances of
Mr John Smith?
This could be solved using a regular expression with negative lookbehind (which is experimentally supported in
Since the support is just experimental, you might want to use
To use regular expressions, use ^ and $
^ is match from the beginning $ is match from end.
The syntax will vary depending on what you are searching for in what file.
You can use regular expressions with sed, grep, awk ....