You are here: preg_match not working « PHP Programming Language « IT news, forums, messages
preg_match not working

Posted by Andrew Richardson on 03/07/06 00:56

Apologies if this has been asked before - I can't find anything on Google or
Google Groups.

I am running PHP 5.0.4 on Apache 2.0.54 with the PCRE extension installed.
For some reason though, the preg_match function is recognised by PHP but it
won't seem to accept any regexes as arguments.

For example:

$result = preg_match("[0-9][0-9]","12")

gives me an error of: Unknown modifier '['

and

$result = preg_match("hello","hello")

gives me an error of: Delimiter must not be alphanumeric or backslash

Am I doing something wrong here?

Thanks in advance

Andrew Richardson

 

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

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