SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Proper Regex to Filter Out Subdomain

    Not exactly a PHP question, but I go to this thread for my Regex confusion from time to time.

    I am using Google Analytics filters (for a subdomain profile) to filter out my primary domain. One filter I have with Regex exclude is this:

    ^www\.domain\.com$

    I think the subdomain is still picking up domain.com, so if I add another filter, would I just do.... domain\.com$

    Is that all it takes?

    Cheers!
    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,031
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    No, domain\.com$ matches all subdomains of domain.com. If you want to match only "domain.com" (and not any of it's subdomains) you should use ^domain\.com$
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •