Please do read full question before marking it duplicate.
I want to validate URL which can contain query string. I found some of the solutions. But It is not working for me.
Examples of valid URLs for me are:
1)http://www.example.com/
2)www.example.com
3)example.com
4)http://www.exaple.com/test2/aa.aspx?id=2&sad=ss
I have used following expression:
1) ^((http|https)://)?([\w-]+\.)+[\w]+(/[\w- ./?]*)?$
But when I used this expression Query string were not allowed.
2) (http|ftp|https)://([\w+?\.\w+])+([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?
But in this http
is required. If i enter URL like: google.com
this expression says it is not valid.
Can anyone help me to validate this?
Thank you in advance.