I have one problem with the expression below. I am trying to do URL validation using regular expression below:
^http(s?):\/\/(\w+\.)?[\w%\-\.$,@?^=%&:\/~\+#]+\.[\w\.$,@?^=%&:\/~\+#]+|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}+\/$
The expression above allows IP address as well as http/https:
. It accepts spaces in between url. (http://example.com). How do I restrict spaces in the expression above?