preg_match not working
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

preg_match not working

From: Andrew Richardson <andrew@ar106REMOVETHIS.wanadoo.co.uk>
Date: Mon Mar 06 2006 - 23:56:32 CET

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
Received on Mon May 1 02:28:31 2006