Re: why does eregi match for whitespace when there is none?
| From: | Erwin | Date: | Fri, 01 Nov 2002 09:31:11 +0000 |
| Subject: | Re: why does eregi match for whitespace when there is none? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122402@lists.php.net to get a copy of this message | ||
Peter J. Schoenster wrote:
> Here is the example:
>
> <?php
>
> $string = 'asfddsaz';
>
> if (eregi('\s', $string)) {
> echo "Whitespace present";
> }else {
> echo "NO Whitespace present";
> }
> ?>
>
> Why does the above return true? There is no whitespace in the string.
> What am I missing?
Try using [[:space:]] when using eregi. See also
http://www.developers-resources.com/stories.php?story=01/10/25/0549771
Grtz Erwin