changed the expression to following and it is checking what i am looking for (hopefully i am not overlooking some thing): var expression = new RegExp(“^([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)@)((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)[a-zA-Z0-9\-]+\.(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|[a-zA-Z]{2}))(\:[0-9]+)(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$”); Per: http://stackoverflow.com/questions/1303872/url-validation-using-javascript
I’m sure if someone tried, they could make it fail. But yes, that looks a bit more serious. I think there are so many possible variations that it’s almost not worth it. You might as well just check there is a dot in it and that’s it.
haha, I agree. I’ve had a similar situation in the past when checking the URL and just decided to put a note of what I am expecting from the user and did a general check.