RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Specific Top-Level Domain (TLD)
Expression
^.*(yourdomain.com).*$
Description
Matches the TLD of a given domain (replace yourdomain.com with whatever domain you're trying to enforce). I was writing an web application in which I wanted to to display a special message to visitors if and only if they were referred to my site by one specific site. However, because the specific site in question was highly dynamic, referring URLs were all over the place in terms of consistency and the only thing I knew I could count on 100% was the TLD (subdomains and file paths acceptable, so long as the TLD matches exactly).
Matches
yourdomain.com | http://www.yourdomain.com | http://subdomain.yourdomain.com/pages/manage/?act=4015876&ag=709254588456a
Non-Matches
your-domain.com | ourdomain.com | yourdomain.co
Author Rating: The rating for this expression. Matt Finazzo
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials