Well, first off you're using eregi instead of preg_match 🙂
There's the possibility that this files uses Windows linebreaks, in which case you need to look for \r as well.
But if you want any whitespace character to mark the end of the URI you could use \s, short for "any whitespace character" (in preg_match; if you're still using ereg it'd be [[:space:]]).