On Fri, Dec 12, 2003 at 07:54:16PM -0800, 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";
: }
You can't use the character class "\s" within a range. And
> Why is this test failing?
> If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
I'm very new to PHP, so I may be barking up the wrong tree, but what is
that "s" doing after the slash? I don't know if it's the cause of the
problem, but as far as I know it's superfluous.
--
Yoroshiku!
Dave G
[EMAIL PROT
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.
3 matches
Mail list logo