-1

For example href://http://facebook.com/groups/

or even

href://http://northumbria.ac.uk/brochure/courses/fees/?view=Standard

this is what i got so far

href="http://.(\..+)+(/.+)*

What I was thinking maybe if it is secured, allow https, and possible www. after the http:// so that would be

href="https?://(w{3}|.+)(\..+)+(/.+)*

So my question is there a way to do this better, more efficiently or simply just make it look nicer ? Or am I missing something there ?

  • possible duplicate of [JS Regex to find href of several a tags](http://stackoverflow.com/questions/13802334/js-regex-to-find-href-of-several-a-tags) – Justin Lessard Jan 23 '14 at 02:07

1 Answers1

0

I just googled it..third hit:

google link

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ 
JacksOnF1re
  • 3,336
  • 24
  • 55