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 @@ -26,11 +26,11 @@ namespace duckdb
2626 // Explanation:
2727 // ^ - Start of the string
2828 // (?: - Non-capturing group for the protocol and domain part
29- // (?:https?:\/\/)? - Optional http:// or https ://
29+ // (?:(?:ftp| https?|rsync) :\/\/)? - Optional ftp://, http://, https://, or rsync ://
3030 // (?:[^\/\s]+) - Domain name (any characters except '/' or whitespace)
3131 // )
3232 // (\/[^?#]*) - Capturing group for the path (starts with '/', followed by any characters except '?' or '#')
33- std::regex path_regex (R"( ^(?:(?:https?:\/\/)?(?:[^\/\s]+))(\/[^?#]*))" );
33+ std::regex path_regex (R"( ^(?:(?:(?:ftp| https?|rsync) :\/\/)?(?:[^\/\s]+))(\/[^?#]*))" );
3434 std::smatch path_match;
3535
3636 // Use regex_search to find the path component in the input string
Original file line number Diff line number Diff line change @@ -53,3 +53,13 @@ query I
5353SELECT extract_path('example.com.ac:443/path/path');
5454----
5555/path/path
56+
57+ query I
58+ SELECT extract_path('ftp://ftp.exmple.com/path/path');
59+ ----
60+ /path/path
61+
62+ query I
63+ SELECT extract_path('rsync://rpki.exmple.com/path/path');
64+ ----
65+ /path/path
You can’t perform that action at this time.
0 commit comments