mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2026-01-25 02:08:27 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2bbc18903c |
@@ -419,7 +419,10 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string strHost(server + offset);
|
std::string strHost(server + offset);
|
||||||
std::regex re("^(.+?):?(\\d+)?(/.*)?$");
|
//- `([^/:]+)` captures the hostname/IP address, match any character except in the set
|
||||||
|
//- `:?([0-9]*)?` optionally captures a colon and the port number, if it's present.
|
||||||
|
//- `(/.*)` captures everything else (the path).
|
||||||
|
std::regex re("([^/:]+):?([0-9]*)?(/.*)?$");
|
||||||
std::smatch matches;
|
std::smatch matches;
|
||||||
if(std::regex_search(strHost, matches, re)) {
|
if(std::regex_search(strHost, matches, re)) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user