I need to match
http/https with or without www. any case (hTtp, WwW, etc)

then after those, mysite.com and then anything after .com

i am trying to write a script to detect if it is on my domain.

I got something to work, but it wouldnt do case insensitive for the url

thanks

    PaPPy wrote:

    I got something to work, but it wouldnt do case insensitive for the url

    Can you show us what it is you had/have?

    If it's a PCRE regexp pattern (e.g. one of the "preg_" functions versus the deprecated "ereg" functions), then simply add the 'i' modifier after your ending delimiter to make the pattern case-insensitive.

      [http://site.com|https://site.com|https://www.site.com|http://www.site.com]

      i was using this to test, preg_match_all under perl
      http://www.spaweditor.com/scripts/regex/index.php

      edited

      [http://site.com|https://site.com|https://www.site.com|http://www.site.com]i

      seems to work, but there's gotta be a cleaner better way to pull that off

        Try something like this instead:

        @https?://(?:www\.)?site\.com@i

        Note that literal periods in a PCRE regexp must be escaped, because the period is used to represent 'any character' (e.g. a wildcard).

          Write a Reply...