Page 1 of 1

cannot resolve spaces in regular expression

Posted: Tue Apr 13, 2004 11:10 pm
by bugthefixer
my code for matching regular expression is
ereg("^[a-zA-Z\s]$",$str);
so far is i know '\s' is used for matching spaces..but my program does not matches spaces but it does match small and capital alphabets..
wat cud be the problem..

Posted: Tue Apr 13, 2004 11:38 pm
by feyd
you are matching only 1 character. add + after the ] should take care of it.