C# .NET - Need regular expression - Asked By abinav shankar on 01-Mar-12 02:45 AM

Hi

I need a regular expression to match the following url

http://test1.Abctest.com/offered_male_single_roommates_in-and-near_danbury-ct

How to do it

Mihir Soni replied to abinav shankar on 01-Mar-12 02:49 AM
Hi Abhinav,

Please use following regular expression

^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$

Let me know if it doesn't work 

Thank you
hema latha replied to Mihir Soni on 01-Mar-12 06:44 AM
HI abhinav try this

^(((h|H?)(t|T?)(t|T?)(p|P?)(s|S?))\://)?(www.|[a-zA-Z0-9].)[a-zA-Z0-9\-\.]+\.[a-zA-Z]*$