> The script works fine but I have a question with the following line:
> $Pattern="(http://)([^[:space:]]+) ([[:alnum:]\.,-?/&=])"; // The
> $Pattern is declared with three groupings.
> My question:
> If the user inadvertantly inputs a *space* _after_ the http://
> _before_ the www. grouping my understanding is that would not be valid
> the $Pattern match due to:
Yes, that's correct. That piece of the pattern matches anything that's
not a space, one or more times.
> I tried the script by putting a space before the URL and the PHP still
> processes the data with no error.
A space before everything is fine, as the pattern will match the
remainder of the string. If you put a ^ at the very beginning of the
pattern, that'll mean the beginning of the string must be followed by
(http), so then a space will cause the patter match to fail.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php