it works if you remove the last $ from the expression, also I think the . needs escaping

unless you have a special reason, use preeg_* as it is supposed to be quicker

Mike

Manuel Ochoa wrote:
Why is this test failing?
$data = "A Simple test.";
If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
echo "Valid text";
}
else {
echo "Not valid text";
}
I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be appreciated.



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to