mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
fix regular expression
This commit is contained in:
parent
f08863ece8
commit
6b5911f82e
1 changed files with 6 additions and 6 deletions
|
|
@ -9,7 +9,7 @@ Url::Url(
|
||||||
smatch results;
|
smatch results;
|
||||||
|
|
||||||
static const regex pattern( // @TODO user:password@#fragment?
|
static const regex pattern( // @TODO user:password@#fragment?
|
||||||
R"regex(^(\w+)://([^:\/]+):?(\d+)?\/?([^\?]+)?\??(.*)?$)regex"
|
R"regex(^((\w+):\/\/)?([^:\/]+)?(:(\d+))?([^\?$]+)?(\?(.*))?)regex"
|
||||||
);
|
);
|
||||||
|
|
||||||
regex_search(
|
regex_search(
|
||||||
|
|
@ -18,11 +18,11 @@ Url::Url(
|
||||||
pattern
|
pattern
|
||||||
);
|
);
|
||||||
|
|
||||||
scheme = results[1];
|
scheme = results[2];
|
||||||
host = results[2];
|
host = results[3];
|
||||||
port = results[3];
|
port = results[5];
|
||||||
path = results[4];
|
path = results[6];
|
||||||
query = results[5];
|
query = results[8];
|
||||||
}
|
}
|
||||||
|
|
||||||
string Url::to_string()
|
string Url::to_string()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue