Last active
February 18, 2020 14:42
-
-
Save klopp/794369f103e63ac50b1a21217a1f7c40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static const boost::regex::flag_type rx_flags = | |
boost::regex_constants::perl| | |
boost::regex_constants::icase| | |
boost::regex_constants::optimize| | |
boost::regex_constants::collate; | |
static boost::regex regex_tcp_v4("((([^:]+)?(:([^@]+))?@)?([^\\/\\?:]+)(:(\\d+))?)?(\\/([^\\?]+)?)?(\\?(.*))?$", rx_flags); | |
static boost::regex regex_tcp_v6("((([^:]+)?(:([^@]+))?@)?(\\[[:\\da-f]+\\])(:(\\d+))?)?(\\/([^\\?]+)?)?(\\?(.*))?$", rx_flags); | |
static boost::regex regex_unix("((([^:]+)?(:([^@]+))?@)?([^:?:]+)(:([^\\?]+))?)?(\\?(.*))?", rx_flags); | |
static boost::regex regex_query("([-\\w+%]+)=([^&;]*)", rx_flags); | |
static boost::regex regex_is_v6("\\[[\\:\\da-f]+\\]", rx_flags); | |
/* | |
erase(0, "tcp://") | |
[3] user | |
[5] password | |
[6] host | |
[8] port | |
[10] dbname | |
[12] query | |
erase(0, unix://) | |
[3] user | |
[5] password | |
[8] socket | |
[10] query | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment