I want to get the query name and values to be displayed from a URL.
For example, url='http://host:port_num/file/path/file1.html?query1=value1&query2=value2'
From this, parse the query names and its values and to print it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I agree that it’s best not to use a regular expression and better to use
urlparse, but here is my regular expression.Classes like
urlparsewere developed specifically to handle all URLs efficiently and are much more reliable than a regular expression is, so make use of them if you can.