> The script works fine but I have a question with the following line: > > $Pattern="(http://)([^[:space:]]+) ([[:alnum:]\.,-?/&=])"; // The variable > $Pattern is declared with three groupings. > > My question: > If the user inadvertantly inputs a *space* _after_ the http:// grouping > and > _before_ the www. grouping my understanding is that would not be valid > from > the $Pattern match due to: > ................ > ([^[:space:]]+) > .................. > > Correct?
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. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php