You are here: Re: [PHP] Regexp trouble « PHP « IT news, forums, messages
Re: [PHP] Regexp trouble

Posted by David Grant on 11/24/05 19:00

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 script it fails.
>
> ereg('^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})'
>
> Does not match my query string.
>
> Which is
>
> Nov 22 06:51:36
>
> Any ideas why? I mean Line start, followed by 3 word chars, followed by a
> space, followed by 2 digits, followed by a space, followed by two digits,
> folowed by a colon followed by 2 digits and followed by a colon, should match
> that date?
>
> With kind regards
>
>
> Andy
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация