Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 regex: disallow some domain names, allow others

View previous topic View next topic Go down 
AuthorMessage
Chuubby
Member
Member
Chuubby

Posts : 9
Join date : 2011-05-20

regex: disallow some domain names, allow others Empty
PostSubject: regex: disallow some domain names, allow others   regex: disallow some domain names, allow others EmptyWed Jun 29, 2011 6:35 am

regex: disallow some domain names, allow others
For example there are URLs http://www.subdomain1.domain.com.uk and http://www.subdomain2.domain.uk, from these URLs I need to extract only the name subdomain1 and subdomain2 accordingly.

But if I receive http://www.subdomain3.co.uk or http://www.subdomain4.com I need to get the whole URL like subdomain3.co.uk and subdomain4.com.

My expression catches whole URL: ^http:\/\/(?:www\.)?((?!SubdomainToNegate|www)[^\.]*\.(?!domain\.com\.uk|domain\.uk).*)$

My situation is shown better over there: http://www.rubular.com/r/qAdMdJoNYb
Back to top Go down
 

regex: disallow some domain names, allow others

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» all of our domain names
» regex check please.
» Finally we got a domain name!
» i want to change domain name that i order

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: regex: disallow some domain names, allow others Edit-trash Useless :: Trash-