|
Posted by Rami Elomaa on 05/11/07 21:06
Toby A Inkster kirjoitti:
> Rami Elomaa wrote:
>
>> preg_match('#^ +$#', $var)
>
> As I read the question, preg_match('#^ *$#', $var) might be better.
Okay, my bad. I thought "nothing but spaces" as "at least one space" but
I suppose no spaces at all might also be included in the case, in which
case the * is better than + like you said.
> If tabs and other whitespace characters are to be allowed, then
> preg_match('#^\s*$#', $var) even better!
Yes, that would be the best choice. It's good you mentioned this as
well, perhaps the OP needs to concider this too. :)
--
Rami.Elomaa@gmail.com
"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
[Back to original message]
|