Can someone please post a regex to extract domain from a url confirming RFC 1738 (http://www.ietf.org/rfc/rfc1738.txt)?
PROTOCOL://USERNAME:PASSWORD@DOMAINNAME:PORT/QUERYSTRING
Example:
https://abc:password@answers.yahoo.com:777/question/index?qid=201007开发者_C百科28205639
Thanks, Sumit
You can find one such regular expression here. You can probably simplify it, but that depends entirely on your needs.
You can also use a library which provides functions for parsing URLs. A good starting point is this Stack Overflow thread: Easy way to parse a url in C++ cross platform?
精彩评论