Is it possible, using grep, to search for instances of John Smith but exclude instances of Mr John Smith?
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
|
|
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 .... Example
|
|||
|
|