Re: Learning regular expressions

2003-03-20 Thread Philip Newton
On 19 Mar 2003 at 19:31, Chris Benson wrote: [Getting ORA books at a discount as a *.pm member] > On Wed, Mar 19, 2003 at 07:06:53PM +0100, Philip Newton wrote: > > (Presumably only works when ordering directly from ORA.) > > Yup, I used to have a card with Josette's contact details, ... I'll try

Re: Learning regular expressions

2003-03-19 Thread Chris Benson
On Wed, Mar 19, 2003 at 07:06:53PM +0100, Philip Newton wrote: > On 18 Mar 2003 at 14:32, Chris Benson wrote: > > [ORA books] > > I blame Josette. You can't turn round without getting a discount: London > > PerlMounger - get a discount, Tyneside PerlMounger - get a discount, > > UKUUG member - get

Re: Learning regular expressions

2003-03-19 Thread Philip Newton
On 18 Mar 2003 at 14:32, Chris Benson wrote: [ORA books] > I blame Josette. You can't turn round without getting a discount: London > PerlMounger - get a discount, Tyneside PerlMounger - get a discount, > UKUUG member - get a discount, ... How does that work? Just mention "I'm a Foo.pm member" wh

Re: Learning regular expressions

2003-03-19 Thread Alex McLintock
> On Tue, Mar 18, 2003 at 12:41:18PM +, Phil Dobbin ([EMAIL PROTECTED]) wrote: > > Hey, I've bought thirty-two O'Reilly books as it is ;-) From: "Dave Cross" <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 3:51 PM > I quick count in the area round my desk at home finds 120 O'Reilly books. >

Re: Learning regular expressions

2003-03-18 Thread David Cantrell
On Tuesday, March 18, 2003 11:29 + Greg McCarroll <[EMAIL PROTECTED]> wrote: * Mark Fowler ([EMAIL PROTECTED]) wrote: You'd be better off with the 2nd Edition. O'Reilly: 0-596-00289-0 http://www.oreilly.com/catalog/regex2/ Shouldn't someone be reviewing this for the site? *looks down at the g

Re: Learning regular expressions

2003-03-18 Thread Luis Campos de Carvalho
- Original Message - From: "Dave Cross" <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 3:51 PM > On Tue, Mar 18, 2003 at 12:41:18PM +, Phil Dobbin ([EMAIL PROTECTED]) wrote: > > > > Hey, I've bought thirty-two O'Reilly books as it is ;-) > > I quick count in the area round my desk

Re: Learning regular expressions

2003-03-18 Thread Dave Cross
On Tue, Mar 18, 2003 at 12:41:18PM +, Phil Dobbin ([EMAIL PROTECTED]) wrote: > > Hey, I've bought thirty-two O'Reilly books as it is ;-) I quick count in the area round my desk at home finds 120 O'Reilly books. There are others at work as well I think. Dave... -- Brian: Oh screw Maximili

Re: Learning regular expressions

2003-03-18 Thread Greg McCarroll
* Chris Benson ([EMAIL PROTECTED]) wrote: > On Tue, Mar 18, 2003 at 12:41:18PM +, Phil Dobbin wrote: > > > Hey, I've bought thirty-two O'Reilly books as it is ;-) > > I'll raise you: (gulp) forty-eight at home[*] including the 1988 > (first?) edition of the X11 manuals. > > I blame Josette.

Re: Learning regular expressions

2003-03-18 Thread Jon Reades
Jonathan Peterson wrote: I assume that this was supposed to be: =~ m/\s*(?:y|(ok))/i I did. But this is hardly easier than 'eq'. Easier for the programmer? Of course not! Heh, when I say better I mean better for the user, and therefore a better bit of software. Programmers are just staff, but

Re: Learning regular expressions

2003-03-18 Thread Chris Benson
On Tue, Mar 18, 2003 at 12:41:18PM +, Phil Dobbin wrote: > Hey, I've bought thirty-two O'Reilly books as it is ;-) I'll raise you: (gulp) forty-eight at home[*] including the 1988 (first?) edition of the X11 manuals. I blame Josette. You can't turn round without getting a discount: London Pe

Re: Learning regular expressions

2003-03-18 Thread Phil Dobbin
On 18/3/03 10:21, "Mark Fowler" <[EMAIL PROTECTED]> wrote: > On Mon, 17 Mar 2003, Phil Dobbin wrote: > >> You can't go wrong with Jeffrey Friedl's `Mastering Regular Expressions' >> (O'Reilly: 1-56592-257-3). > > You'd be better off with the 2nd Edition. [...] Hey, I've bought thirty-two O'Rei

Re: Learning regular expressions

2003-03-18 Thread Marty Pauley
On Tue Mar 18 10:21:20 2003, Mark Fowler wrote: > On Mon, 17 Mar 2003, Phil Dobbin wrote: > > > You can't go wrong with Jeffrey Friedl's `Mastering Regular Expressions' > > (O'Reilly: 1-56592-257-3). > > You'd be better off with the 2nd Edition. Or you could come to Belfast next Monday and hear

Re: Learning regular expressions

2003-03-18 Thread Greg McCarroll
* Mark Fowler ([EMAIL PROTECTED]) wrote: > On Mon, 17 Mar 2003, Phil Dobbin wrote: > > > You can't go wrong with Jeffrey Friedl's `Mastering Regular Expressions' > > (O'Reilly: 1-56592-257-3). > > You'd be better off with the 2nd Edition. > > O'Reilly: 0-596-00289-0 > http://www.oreilly.com/cata

Re: Learning regular expressions

2003-03-18 Thread Kris Boulez
Quoting Mark Fowler ([EMAIL PROTECTED]): > On Mon, 17 Mar 2003, Phil Dobbin wrote: > > > You can't go wrong with Jeffrey Friedl's `Mastering Regular Expressions' > > (O'Reilly: 1-56592-257-3). > > You'd be better off with the 2nd Edition. > > O'Reilly: 0-596-00289-0 > http://www.oreilly.com/cata

Re: Learning regular expressions

2003-03-18 Thread Mark Fowler
On Mon, 17 Mar 2003, Phil Dobbin wrote: > You can't go wrong with Jeffrey Friedl's `Mastering Regular Expressions' > (O'Reilly: 1-56592-257-3). You'd be better off with the 2nd Edition. O'Reilly: 0-596-00289-0 http://www.oreilly.com/catalog/regex2/ Shouldn't someone be reviewing this for the si

RE: Learning regular expressions

2003-03-18 Thread Gareth Kirwan
Hey - I didn't realise there was a second edition. Mastering Regular expressions is what I learnt from, found it great. Gareth > -Original Message- > [mailto:[EMAIL PROTECTED] Behalf Of Mark Fowler > > You'd be better off with the 2nd Edition. > > O'Reilly: 0-596-00289-0 > http://www.o

Re: Learning regular expressions

2003-03-17 Thread David H. Adler
On Mon, Mar 17, 2003 at 03:24:05PM +, Shevek wrote: > On Mon, 17 Mar 2003, Jon Reades wrote: > > > Work wrote: > > > > > if($userinput eq 'y') ## yucky > > > { > > > ... > > > } > > > > Uh, why? > > > > If all you care about is the case 'y' then this is a much better and > > faster way to

Re: Learning regular expressions

2003-03-17 Thread Jonathan Peterson
> > > > I assume that this was supposed to be: > > =~ m/\s*(?:y|(ok))/i I did. > > > > But this is hardly easier than 'eq'. > Easier for the programmer? Of course not! Heh, when I say better I mean better for the user, and therefore a better bit of software. Programmers are just staff, but use

Re: Learning regular expressions

2003-03-17 Thread Jonathan Peterson
> > > > I assume that this was supposed to be: > > =~ m/\s*(?:y|(ok))/i I did. > > > > But this is hardly easier than 'eq'. > Easier for the programmer? Of course not! Heh, when I say better I mean better for the user, and therefore a better bit of software. Programmers are just staff, but use

Re: Learning regular expressions

2003-03-17 Thread Phil Dobbin
On 13/3/03 17:05, "Adam C Auden" <[EMAIL PROTECTED]> wrote: > On Thu, 13 Mar 2003, Peter Sergeant wrote: > >> This seems to be a recurring theme - regular expressions are hard. This >> is not my experience. After QBasic, Perl was the first language I >> learned, and regular expressions were a top

Re: Learning regular expressions

2003-03-17 Thread Luis Campos de Carvalho
- Original Message - From: "Jon Reades" <[EMAIL PROTECTED]> Sent: Monday, March 17, 2003 12:09 PM > Work wrote: > > > if($userinput eq 'y') ## yucky > > > > if($userinput =~ /^\s*y|(ok)/i) # nice > > { > > ... > > } > > Heh, heh, *this* is nice? > > I assume that this was supposed to be

Re: Learning regular expressions

2003-03-17 Thread Shevek
On Mon, 17 Mar 2003, Jon Reades wrote: > Work wrote: > > > if($userinput eq 'y') ## yucky > > { > > ... > > } > > Uh, why? > > If all you care about is the case 'y' then this is a much better and > faster way to determine the truth or falsehood of the statement. It's > also, IMO, the clearest

Re: Learning regular expressions

2003-03-17 Thread Jon Reades
Work wrote: if($userinput eq 'y') ## yucky { ... } Uh, why? If all you care about is the case 'y' then this is a much better and faster way to determine the truth or falsehood of the statement. It's also, IMO, the clearest of all. If you really wanted to handle a couple of differenct options,

Re: Learning regular expressions

2003-03-14 Thread David Cantrell
On Thu, Mar 13, 2003 at 04:24:16PM +, Peter Sergeant wrote: > I wonder why it is some people find regexes such a mind-twister. Trying to run before they can walk? Some of the new stuff confuses the hell out of me still, but then almost all my regex needs could be fulfilled even by perl4. I m

Re: Learning regular expressions

2003-03-14 Thread Jonathan Peterson
> But it sort of proves the point, anyway, in that Mr Peterson wrote his regexp > wrong. Yup. > If he didn't mean > > /^\s*(y|ok)/i > Yeah, that's what I wanted to write. Stupid precedence rules - Perl didn't do what I meant! :-P However, I suggest that the debug cycle incurred by mis-use of re

Re: Learning regular expressions

2003-03-14 Thread Luis Campos de Carvalho
- Original Message - From: "Work" <[EMAIL PROTECTED]> Sent: Friday, March 14, 2003 8:02 AM > > > [...] its foundations. IMHO, its simply impossible > > > learn good quality regexp use unless you have > > > good regular grammars theory before. > > > > No, that's WRONG. Again, I can only gi

Re: Learning regular expressions

2003-03-14 Thread Jasper McCrea
Jasper McCrea wrote: > > Work wrote: > > > > if($userinput =~ /^\s*y|(ok)/i) # nice > > { > > ... > > } > > Going some way to prove that regexps are complicated (for me, anyway), this does > not do what I thought it would. > > /foo|bar/ matches foo or bar, obviously. > > /foo|(bar)/ (as in the

Re: Learning regular expressions

2003-03-14 Thread Jasper McCrea
Work wrote: > > if($userinput =~ /^\s*y|(ok)/i) # nice > { > ... > } Going some way to prove that regexps are complicated (for me, anyway), this does not do what I thought it would. /foo|bar/ matches foo or bar, obviously. /foo|(bar)/ (as in the yes/ok case above) matches totally different stu

Re: Learning regular expressions

2003-03-14 Thread Work
> > I think that Regexps are hard to learn because the most part of the folks > > that aren't too much scared to learn it just lack the essential and > > unavoidable compiler theory where regexp lays its foundations. IMHO, its > > simply impossible learn good quality regexp use unless you have go

Re: Learning regular expressions

2003-03-14 Thread Mark Fowler
On Thu, 13 Mar 2003, Adam C Auden wrote: > Not sure you can give a complete answer to this one, however I for one > find regular expressions tricky due to the lack of decent docs available > for them - particularly lack of examples to work from. The "perlre" the traditional documentation came wit

Re: Learning regular expressions

2003-03-13 Thread Peter Sergeant
> I disagree. Regexps are quite well documented. There is even a manpage > exclusively dedicated to it. =-] Though actually most of the docs used to be split between perlop and perlre, neither of which are friendly pieces of text. I believe this situation has ameliorated a little, but, certainly

Re: Learning regular expressions

2003-03-13 Thread Luis Campos de Carvalho
> On Thu, 13 Mar 2003, Peter Sergeant wrote: > > [...] I wonder why it is > > some people find regexes such a mind-twister. > From: "Adam C Auden" <[EMAIL PROTECTED]> > Sent: Thursday, March 13, 2003 2:05 PM > Not sure you can give a complete answer to this one, > however I for one find regular e

Re: Learning regular expressions

2003-03-13 Thread Lusercop
On Thu, Mar 13, 2003 at 04:24:16PM +, Peter Sergeant wrote: > This seems to be a recurring theme - regular expressions are hard. This > is not my experience. After QBasic, Perl was the first language I (apart from the qbasic bit) -- Lusercop.net - LARTing Lusers everywhere since 2002

Re: Learning regular expressions

2003-03-13 Thread Adam C Auden
On Thu, 13 Mar 2003, Peter Sergeant wrote: > This seems to be a recurring theme - regular expressions are hard. This > is not my experience. After QBasic, Perl was the first language I > learned, and regular expressions were a topic I found very easy (and > there were plenty of topics I found hard

Re: Learning regular expressions

2003-03-13 Thread Aaron Trevena
On Thu, 13 Mar 2003, Peter Sergeant wrote: > > If you've never heard of grep, glob, split, local/gmtime, unlink, > > STDIN, ARGV, ... or seen a regular expression, it's all pretty > > bewildering. Even if you have, there's all the chop/chomp/splice/... > > cuteness to confuse. > > This seems to