0

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:[email protected]:777/question/index?qid=20100728205639

Thanks, Sumit

4

1 Answer 1

0

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.