File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ namespace duckdb
3030 Connection con (db);
3131
3232 // Extract the host from the URL
33- std::regex host_regex (R"( ^(?:https?:\/\/)?([^\/\?:]+))" );
33+ std::regex host_regex (R"( ^(?:(?: https?|ftp|rsync) :\/\/)?([^\/\?:]+))" );
3434 std::smatch host_match;
3535 if (!std::regex_search (input, host_match, host_regex))
3636 {
Original file line number Diff line number Diff line change @@ -124,6 +124,16 @@ SELECT extract_tld('https://example.com.ac:443/path/path');
124124----
125125com.ac
126126
127+ query I
128+ SELECT extract_tld('ftp://ftp.example.com/path/path');
129+ ----
130+ com
131+
132+ query I
133+ SELECT extract_tld('rsync://rpki.example.com/path/path');
134+ ----
135+ com
136+
127137
128138query I
129139SELECT extract_tld('com.ac');
You can’t perform that action at this time.
0 commit comments