Gentoo Archives: gentoo-user

From: Robin Atwood <robin.atwood@×××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Need help with a regex
Date: Sat, 24 May 2008 15:44:06
Message-Id: 200805242243.59897.robin.atwood@attglobal.net
In Reply to: Re: [gentoo-user] Need help with a regex by Andrey Falko
1 On Saturday 24 May 2008, Andrey Falko wrote:
2 > On Sat, May 24, 2008 at 11:32 AM, Andrey Falko <ma3oxuct@×××××.com> wrote:
3 > > On Sat, May 24, 2008 at 11:22 AM, Robin Atwood
4 > >
5 > > <robin.atwood@×××××××××.net> wrote:
6 > >> Regexs are not my strong point! I am trying to get a list of service
7 > >> scripts that provide virtual services. Each such script contains a line
8 > >> like:
9 > >>
10 > >> provide dns
11 > >>
12 > >> i.e. the line starts with one or more spaces, followed by the text
13 > >> "provide", followed by one or more spaces and a single word. i have come
14 > >> up with:
15 > >>
16 > >> grep -e ^\s+provide\s+\w /etc/init.d
17 > >
18 > > Right now you are saying: match one or more spaces in the begining
19 > > followed by provide followed by one or more spaces followed by *one*
20 > > word followed by one space and followed by /etc/init.d
21 > >
22 > > I think you mean: grep -e ^\s+provide\s+\w+ /etc/init.d
23 > >
24 > >> but, as usual, nothing is matched. What am I doing wrong?
25 >
26 > I see your mistake....\w means alphanumeric character, not word.
27
28 I had just realised that myself. However, it still doesn't work. :(
29 Thanks for trying, though.
30
31 -Robin
32
33
34
35
36
37
38
39
40
41
42 --
43 gentoo-user@l.g.o mailing list