Text this: Verified by me:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Regex for urls with or without http Page</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
$('#btnValidate').click(function() {
var txt = $('#txturl').val();
var re = /(http(s)?:\\)?([\w-]+\.)+[\w-]+[.com|.in|.org]+(\[\?%&=]*)?/
if (re.test(txt)) {
alert('Valid URL')
}
else {
alert('Please Enter Valid URL');
return false;
}
})
})
</script>
</head>
<body>
<div>
Enter URL :<input type="text" id="txturl" />
<input type="button" id="btnValidate" value="Validate" />
</div>
</body>
</html>