-2

I've been trying to write a regular expression to match the URL of a website. Apparently

(http:\/\/www.)([a-zA-Z0-9])(\.[a-zA-z])\/"\s

does not work. The URL has to start with http://www. and can have up to one or more alpha numeric characters.

2 Answers2

2

What about type into the google : "regular expression url" and clik on the first result?

regular expression for url

Community
  • 1
  • 1
libik
  • 19,204
  • 9
  • 35
  • 72
1

Use Apache Commons' UrlValidator:

http://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/UrlValidator.html

Neil McGuigan
  • 41,314
  • 10
  • 106
  • 137