File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ namespace duckdb
3535 Connection con (db);
3636
3737 // Extract the host from the URL
38- std::regex host_regex (R"( ^(?:https?:\/\/)?([^\/\?:]+))" );
38+ std::regex host_regex (R"( ^(?:(?: https?|ftp|rsync) :\/\/)?([^\/\?:]+))" );
3939 std::smatch host_match;
4040 if (!std::regex_search (input, host_match, host_regex))
4141 {
Original file line number Diff line number Diff line change @@ -144,6 +144,16 @@ SELECT extract_domain('com:443');
144144----
145145com
146146
147+ query I
148+ SELECT extract_domain('ftp://example.com/path');
149+ ----
150+ example.com
151+
152+ query I
153+ SELECT extract_domain('rsync://rpki.example.com/path');
154+ ----
155+ example.com
156+
147157query I
148158SELECT extract_domain('c');
149159----
@@ -162,4 +172,4 @@ SELECT extract_domain('http:/example.com.ac/path');
162172query I
163173SELECT extract_domain('http:/example.com.ac:443/path');
164174----
165- (empty)
175+ (empty)
You can’t perform that action at this time.
0 commit comments