Page 1 of 1

what's wrong with this?

Posted: Wed Feb 26, 2003 5:12 am
by reebes
preg_match("/^([\000-\177]|[\200-\377][\200-\377])*([\000-\177]|[\200-\377][\200-\377])$/", $str)

error info:
Warning: No ending delimiter '/' found

Posted: Wed Feb 26, 2003 7:44 am
by volka
try

Code: Select all

preg_match('/^([\000-\177]|[\200-\377][\200-\377])*([\000-\177]|[\200-\377][\200-\377])$/', $str)

Posted: Wed Feb 26, 2003 8:13 am
by Stoker
Using single quotes removes the purpose of \nnn so that will compile but not work..

I think the problem is \000, as many strings and things here and there uses NULL as termination, is it likely that your $str contains any NULL's? try with startpoint \001 instead

Posted: Wed Feb 26, 2003 8:52 am
by volka
:oops: right

thank you very much

Posted: Thu Feb 27, 2003 6:08 am
by reebes
now it can work after i change to this:

if (preg_match("/^([0-\177]|[\200-\377][\200-\377])*([0-\177]|[\200-\377][\200-\377])$/", $str))