wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to validate the website URL  through JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to validate the website URL  through JavaScript" Watch "How to validate the website URL  through JavaScript" New topic
Author

How to validate the website URL through JavaScript

sandeep kethe
Greenhorn

Joined: Jan 11, 2009
Posts: 14
HI
I am fairly new to Java Script. Can anyone help me how to validate the website URL using Javascript.I am uSing this regural expression however its not working.
Here is the expression /^(http:\/\/www.|www.){1}([\w]+)(.[\w]+){1,2}$/;

Regards
K.Sandeep
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
That reg expression looks like it will fail many cases, take a look at the one here:
http://snippets.dzone.com/posts/show/452

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to validate the website URL through JavaScript