Re: [PHP] Regexp trouble

2005-11-24 Thread Frank Armitage
Andy Pieters wrote: > > Err.. why NOT use character classes? What is easier [0-9] or \d or maybe > [a-zA-Z] or [\w], ... ? > Well, first of all the square brackets in [\w] aren't needed, \w already means 'any "word" character'. Secondly, [a-zA-Z] is not the same as \w: " A "word" character i

Re: [PHP] Regexp trouble

2005-11-24 Thread Andy Pieters
Thanks all for your contributions. Seems like the missing link was the delimiter. On Thursday 24 November 2005 18:23, Frank Armitage wrote: > > And why do you use all those character > classes? > Err.. why NOT use character classes? What is easier [0-9] or \d or maybe [a-zA-Z] or [\w], ... ?

Re: [PHP] Regexp trouble

2005-11-24 Thread Jochem Maas
Andy Pieters wrote: Hi list I still fail to understand why regular expressions are causing me such a hard time. er, because they are hard? hey you failed! we have a club :-) I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev]) but when I put it in the php script it

Re: [PHP] Regexp trouble

2005-11-24 Thread Frank Armitage
Andy Pieters wrote: > Hi list > > I still fail to understand why regular expressions are causing me such a hard > time. > > Hi! Why don't you use 'preg_match'? And why do you use all those character classes? This: $subject = 'Nov 22 06:51:36'; $pattern = '/^(\w{3})\s(\d{2}

Re: [PHP] Regexp trouble

2005-11-24 Thread David Grant
Andy, Try preg_match instead of ereg. Cheers, David Grant Andy Pieters wrote: > Hi list > > I still fail to understand why regular expressions are causing me such a hard > time. > > I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev]) > but when I put it in the php s