Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread Stuart Sears
On 06/03/11 17:42, Vic 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 barf

Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread bryan hunt
On Sun, 2011-03-06 at 17:42 +, Vic wrote: > pattern along the lines of: > foo(bar > thought a regex of > foo\(.* > grep tells me > grep: Unmatched ( or \( > ...Which I knew. I'm specifically looking for an unmatched \(. echo "sadffdfoo(barblah vbflhaasd" | grep "foo(bar" -- Please post

Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread Victor Churchill
1. I too thought you might need to backslash the paren but i does indeed complain. 2. You also need to tell grep to not report cases where the paren *is* closed. 3. If you use single quote (which I think tells the shell to not examine the contents for interpolation): victor@pan2:/tmp$ grep -e '^.

Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread Peter Salisbury
Put the parenthesis in square brackets to indicate it's a single character? HTH Peter On 6 Mar 2011 17:42, "Vic" 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

Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread Simon Reap
On 06/03/2011 17:42, Vic 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 I just did grep 'foo(bar' file and it worked fine. (Ubuntu 10.10) -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://m

Re: [Hampshire] Any grep gurus here?

2011-03-06 Thread Jonathan Hudson
On Sun, 6 Mar 2011 17:42:26 - (GMT) "Vic" 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 m

[Hampshire] Any grep gurus here?

2011-03-06 Thread Vic
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'