what's wrong with this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
reebes
Forum Newbie
Posts: 2
Joined: Wed Feb 26, 2003 5:12 am

what's wrong with this?

Post by reebes »

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

error info:
Warning: No ending delimiter '/' found
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try

Code: Select all

preg_match('/^([\000-\177]|[\200-\377][\200-\377])*([\000-\177]|[\200-\377][\200-\377])$/', $str)
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

:oops: right
reebes
Forum Newbie
Posts: 2
Joined: Wed Feb 26, 2003 5:12 am

thank you very much

Post 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))
Post Reply