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
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
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 '^.
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
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
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
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'