From: Mikko Rasa Date: Wed, 10 Aug 2011 19:18:46 +0000 (+0300) Subject: Fix URL regex X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ebf4d62dd7d119b79cbd3c64570949dbdf9cdde9;p=libs%2Fnet.git Fix URL regex --- diff --git a/source/http/utils.cpp b/source/http/utils.cpp index 5a5dc04..870b86f 100644 --- a/source/http/utils.cpp +++ b/source/http/utils.cpp @@ -79,7 +79,7 @@ string urldecode(const string &str) Url parse_url(const string &str) { - static Regex r_url("(([a-z]+)://)?([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(:[0-9])?)?(/[^?#]*)?(\\?([^#]+))?(#(.*))?"); + static Regex r_url("^(([a-z]+)://)?([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(:[0-9]+)?)?(/[^?#]*)?(\\?([^#]+))?(#(.*))?$"); if(RegMatch m = r_url.match(str)) { Url url;