You are here: Re: newbie. preg_match() error, « PHP Programming Language « IT news, forums, messages
Re: newbie. preg_match() error,

Posted by Rik on 08/14/07 11:01

On Tue, 14 Aug 2007 12:55:34 +0200, wizard <vivek.j.joshi@gmail.com> wro=
te:

> Hello,
> I am trying to create a function that will match only valid date in mm=
/
> dd format. (Month in, 01, 02, ..., 09, 10, 11, 12 and Dates in 01,
> 02, ..., 11, 12, ..., 30, 31).
>
> I am trying this code, but it fails to work.
>
> The error is :-
> PHP Warning: preg_match(): Compilation failed: unmatched parentheses
> at offset 15 in /home/wizard/regexDateTime.php on line xx
>
> The code is here.
> <?php
> $test =3D '03/02';
>
> $testPattern =3D '#[(0[1-9]|1[012])/(0[1-9]|[12][0-9]|3[01])]#=
';
---------------------------^----------------------------------------^

remove the blockquotes there (possibly replace them with ^ and =

$ respectively).
-- =

Rik Wasmus

 

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

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