Re: Question relating regexp

2003-01-17 Thread Rob Benton
On Fri, 2003-01-17 at 08:03, Robert Land wrote: > This is a example one can find on one of the links > discribed in the deb HOWTO package: > > =Section Multipliers(text just pasted): > > > " > An example from the phone list: > > 1248 Kate 634 > > 1548 Kerry 534 > > > To match

Re: Question relating regexp

2003-01-17 Thread Alan Shutko
[EMAIL PROTECTED] (Robert Land) writes: > =Why, in the first example, has the author > prefaced the char 'K' with the one or more > times multiplier? He only wants to find a > name beginning with 'K'(!) The * applies to the space before the k, so " *" means "one or more spaces". In other words

Re: Question relating regexp

2003-01-17 Thread Clive Standbridge
On Fri 17 Jan 2003 15:03:33 +(+0100), Robert Land wrote: > > To match a line that starts with a 1, > has some digits, at least one space > and a name that starts with a K we can write: > > grep '^1[0-9]\{1,\} \{1,\}K' phonelist.txt > or use * and repeat [0-9] and space: > grep '^1[0-9][0-9]

Re: Question relating regexp

2003-01-17 Thread andrej hocevar
On Fri, Jan 17, 2003 at 03:03:33PM +0100, Robert Land wrote: > grep '^1[0-9]\{1,\} \{1,\}K' phonelist.txt > or use * and repeat [0-9] and space: > grep '^1[0-9][0-9]* *K' phonelist.txt > > =Why, in the first example, has the author > prefaced the char 'K' with the one or more > times multiplier?

Re: Question relating regexp

2003-01-17 Thread Colin Watson
On Fri, Jan 17, 2003 at 03:03:33PM +0100, Robert Land wrote: > " > An example from the phone list: > > 1248 Kate 634 > > 1548 Kerry 534 > > > To match a line that starts with a 1, > has some digits, at least one space > and a name that starts with a K we can write: > > grep '^

Re: Question relating regexp

2003-01-17 Thread Craig Dickson
Robert Land wrote: > An example from the phone list: > > 1248 Kate 634 > > 1548 Kerry 534 > > > To match a line that starts with a 1, > has some digits, at least one space > and a name that starts with a K we can write: > > grep '^1[0-9]\{1,\} \{1,\}K' phonelist.txt > or use *

Re: Question relating regexp

2003-01-17 Thread Nicos Gollan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 17 January 2003 15:03, Robert Land wrote: > grep '^1[0-9]\{1,\} \{1,\}K' phonelist.txt > or use * and repeat [0-9] and space: > grep '^1[0-9][0-9]* *K' phonelist.txt > " > > > =Why, in the first example, has the author > prefaced the char 'K

Re: Question relating regexp

2003-01-17 Thread Peter Hugosson-Miller
Robert Land wrote: > An example from the phone list: > > 1248 Kate 634 > > 1548 Kerry 534 > > > To match a line that starts with a 1, > has some digits, at least one space > and a name that starts with a K we can write: > > grep '^1[0-9]\{1,\} \{1,\}K' phonelist.txt > or use * an

Question relating regexp

2003-01-17 Thread Robert Land
This is a example one can find on one of the links discribed in the deb HOWTO package: =Section Multipliers(text just pasted): " An example from the phone list: 1248 Kate 634 1548 Kerry 534 To match a line that starts with a 1, has some digits, at least one space and a name