I need to use a regular expression in grep inside a bash script where I am trying to find the following occurrences inside a file:
foo,
foo ,
foo)
foo )
In the file, there are multiple occurrences of this word in other patterns that I want to ignore, like:
foo"
foo.
etc
Right now I am doing individual grep for each, but I want to use a single expression for all of these. I tried 'foo.,' and 'foo.)', but I still need 2 expressions and it (obviously) gives me matches with any character at the place of . which I don't want. What can I use?