Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35803

Re: ignore case only for a part of the regex?

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: ignore case only for a part of the regex?
Date 2012-12-30 10:20 -0500
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-4F8381.10201930122012@news.panix.com> (permalink)
References <50e02485$0$3109$ba620e4c@news.skynet.be>

Show all headers | View raw


Helmut Jarausch <jarausch@skynet.be> wrote:

> is there a means to specify that 'ignore-case' should only apply to a part
> of a regex?

Not that I'm aware of.
 
> the regex should match  Msg-id:, Msg-Id, ...  but not  msg-id: and so on.

What's the use-case for this?

The way I would typically do something like this is build my regexes in 
all lower case and .lower() the text I was matching against them.  I'm 
curious what you're doing where you want to enforce case sensitivity in 
one part of a header, but not in another.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

re: ignore case only for a part of the regex? Helmut Jarausch <jarausch@skynet.be> - 2012-12-30 11:24 +0000
  Re: ignore case only for a part of the regex? Roy Smith <roy@panix.com> - 2012-12-30 10:20 -0500
    Re: ignore case only for a part of the regex? Joel Goldstick <joel.goldstick@gmail.com> - 2012-12-30 10:41 -0500
    Re: ignore case only for a part of the regex? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-01 04:14 +0000
      Re: ignore case only for a part of the regex? Vlastimil Brom <vlastimil.brom@gmail.com> - 2013-01-02 00:09 +0100
        Re: ignore case only for a part of the regex? wxjmfauth@gmail.com - 2013-01-02 06:17 -0800
        Re: ignore case only for a part of the regex? wxjmfauth@gmail.com - 2013-01-02 06:17 -0800
  Re: ignore case only for a part of the regex? Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-12-30 17:38 +0100
    Re: ignore case only for a part of the regex? Roy Smith <roy@panix.com> - 2012-12-30 12:32 -0500
      Re: ignore case only for a part of the regex? MRAB <python@mrabarnett.plus.com> - 2012-12-30 18:04 +0000
      Re: ignore case only for a part of the regex? Cameron Simpson <cs@zip.com.au> - 2012-12-31 11:29 +1100

csiph-web