Regular expression validation for URL

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
i have a regex method as follws public bool IsValidUrl(string url)
{
var urlRx = new Regex(@"^(http|https)://([w+?.w+])+([a-zA-Z0-9~!@#$%^&*()_-=+\/?.:;,]*)?$");

return urlRx.IsMatch(url);
}
in URL text box am passing same url as 3 times
http://120.11.200.19:372512345/demo?wsdlhttp://120.11.200.19:372512345/demo?wsdl http://120.11.200.19:372512345/demo?wsdl
text box was allowing. it is a valid url but it is repeated more than once.. how can i restrict this please help me

View the full article
 
Back
Top