From 6b5911f82e584f09759f989740f53faccf786552 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 14 Aug 2024 23:55:03 +0300 Subject: [PATCH] fix regular expression --- src/lib/url.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/url.cpp b/src/lib/url.cpp index 57758c40..96475e17 100644 --- a/src/lib/url.cpp +++ b/src/lib/url.cpp @@ -9,7 +9,7 @@ Url::Url( smatch results; static const regex pattern( // @TODO user:password@#fragment? - R"regex(^(\w+)://([^:\/]+):?(\d+)?\/?([^\?]+)?\??(.*)?$)regex" + R"regex(^((\w+):\/\/)?([^:\/]+)?(:(\d+))?([^\?$]+)?(\?(.*))?)regex" ); regex_search( @@ -18,11 +18,11 @@ Url::Url( pattern ); - scheme = results[1]; - host = results[2]; - port = results[3]; - path = results[4]; - query = results[5]; + scheme = results[2]; + host = results[3]; + port = results[5]; + path = results[6]; + query = results[8]; } string Url::to_string()