in reply to Can you have partial case-insensitivty in a regexp?

Sure, if you check the perlre manpage you will see that the (?imsx-imsx:pattern) construct will do it:

/<a href="http:\/\/(?i:somelink.com)"/

I suggest you use a delimiter other than / because of the leaning toothpick symdrome it creates in this instance. Also, you should keep in mind that HTML tag names and paramater names are not case sensitive, and neither is the protocol name, so you might just want to make the whole pattern case insensitive in this case. It is only the path of the URL after the hostname that is case sensitive.

Replies are listed 'Best First'.
Re^2: Can you have partial case-insensitivty in a regexp?
by Anonymous Monk on Dec 19, 2005 at 08:09 UTC
    In XHTML all the tags and parameter names are case sensitive -> they're all lowercase. I don't know about the protocol name, but sure there's some URI reference where it says it's lowercase. I agree with the leaning toothpick syndrome, you should change your delimiters.
      Right. The URI references isn't a paremeter name though, it's a value, so XHTML says it can have any case. And DNS says that hostnames are case insensitive (AFAIK), so perlmonks.org, PerlMonks.org or pErLmOnKs.oRg are all the same.

      -- zigdon