src/CLIParser.h
branchv_0
changeset 29 97fe991ad2cb
parent 20 ad21bff45051
equal deleted inserted replaced
28:f2697551bfd5 29:97fe991ad2cb
    83 		using namespace options;
    83 		using namespace options;
    84 
    84 
    85 		// Parse the connection string and convert it to options:
    85 		// Parse the connection string and convert it to options:
    86 		if (connectionString.size()) {
    86 		if (connectionString.size()) {
    87 			std::string connectionStringBytes = convertor.to_bytes(connectionString);
    87 			std::string connectionStringBytes = convertor.to_bytes(connectionString);
    88 			std::regex pattern("(tcp|udp|sctp)://(([^:]+)|\\[([0-9a-fA-F:]+(%[a-zA-Z0-9]+))\\]):([0-9]+)|(uds)://(.*)");
    88 			std::regex pattern("(tcp|udp|sctp)://(([^:]+)|\\[([0-9a-fA-F:]+(%[a-zA-Z0-9]+)?)\\]):([0-9]+)|(uds)://(.*)");
    89 			//                  1                23          4             5                    6        7       8
    89 			//                  1                23          4             5                    6        7       8
    90 			std::smatch match;
    90 			std::smatch match;
    91 			if (std::regex_match(connectionStringBytes, match, pattern)) {
    91 			if (std::regex_match(connectionStringBytes, match, pattern)) {
    92 				setIfMissing(c.options, OPTION_PROTOCOL, match[1], false);
    92 				setIfMissing(c.options, OPTION_PROTOCOL, match[1], false);
    93 				setIfMissing(c.options, OPTION_PROTOCOL, match[7], false);
    93 				setIfMissing(c.options, OPTION_PROTOCOL, match[7], false);