Re: [PHP] Problems with patterns

2004-04-21 Thread Phpu
where in the ereg("^[a-zA-Z0-9_]{3,15}$", $cuvant) i should place \s+ ? - Original Message - From: "Matt Matijevich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, April 22, 2004 3:34 AM Subject: Re: [PHP] Problems

Re: [PHP] Problems with patterns

2004-04-21 Thread Matt Matijevich
you need to account fir white space if you want phrases \s+ I would switch to preg_match() instead of ereg() http://www.php.net/manual/en/function.preg-match.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problems with patterns

2004-04-21 Thread Phpu
Hi, i have a script that searches a database after a specific word. this function check the entered word function valid_word($word) { if(ereg("^[a-zA-Z0-9_]{3,15}$", $word)) { return true; } else { return false; } } If i search for a word is ok but when i searches for a phra