On Sun, 6 Mar 2011 17:42:26 -0000 (GMT)
"Vic" <l...@beer.org.uk> wrote:

> 
> Hi All.
> 
> I need some help with regexes in grep.
> 
> I'm trying to search for a pattern along the lines of:
> 
>   foo(bar
> 
> Note that there is no closing bracket.
> 
> Like an eejit, I thought a regex of
> 
>   foo\(.*
> 
> would match that - but grep barfs. It tells me
> 
>   grep: Unmatched ( or \(
> 
> ...Which I knew. I'm specifically looking for an unmatched \(.
> 
> Does anyone know how to make it do what I want? Using grep -F or fgrep is
> not an option - this is part of a much bigger set of searches that I can't
> disrupt.
>

I don't think the error is referring to that which you're searching
for, rather that '(' is used for grouping and you haven't escaped it
enough (both from the shell and from grep). More judicious use of \ may
be required.

-jonathan
(not a grep guru)

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------

Reply via email to