Page 1 of 1

Regex for links

Posted: Mon Sep 27, 2010 5:32 am
by klevis miho
I have this regex:
'#(([a-zA-Z0-9-]+)\.)*([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)#'

which is good, except that it doesn't get links with a directory behind like:
domain.com/directory

How to solve this?

Re: Regex for links

Posted: Mon Sep 27, 2010 5:44 am
by DigitalMind
try '#(([a-zA-Z0-9-]+)\.)*([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)(/[a-zA-Z0-9-]+)*#'

Re: Regex for links

Posted: Mon Sep 27, 2010 5:53 am
by klevis miho
Thanx