]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/utils.cpp
Fix URL regex
[libs/net.git] / 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;