]> git.tdb.fi Git - libs/net.git/commitdiff
Fix URL regex
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 19:18:46 +0000 (22:18 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Aug 2011 19:18:46 +0000 (22:18 +0300)
source/http/utils.cpp

index 5a5dc0487c0f1bf4dbd9132143e14567d7c30574..870b86fea19ac54ee53c14f7e377a92a68dc5a42 100644 (file)
@@ -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;