468,484 Members | 1,645 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

re.IGNORECASE and re.VERBOSE

I am using regular expressions and I would like to use both
re.IGNORECASE and re.VERBOSE options. I want to do something like the
following (which doesn't work):

matsearch = r'''^\ {0,4}([mM]\d+) '''
MatSearch = re.compile(matsearch, re.VERBOSE, re.IGNORECASE)

Does anyone have any suggestions?
Thanks,
Jeremy
Jul 21 '05 #1
1 2544
Jeremy wrote:
I am using regular expressions and I would like to use both
re.IGNORECASE and re.VERBOSE options. I want to do something like the
following (which doesn't work):

matsearch = r'''^\ {0,4}([mM]\d+) '''
MatSearch = re.compile(matsearch, re.VERBOSE, re.IGNORECASE)

Does anyone have any suggestions?


These flags are combined using the bit-wise OR operator.

re.compile(matsearch, re.VERBOSE|re.IGNORECASE)

Reinhold
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Pascal | last post: by
3 posts views Thread by chemag | last post: by
reply views Thread by Adam H. Pendleton | last post: by
reply views Thread by Ananda Sim | last post: by
1 post views Thread by brainstorm | last post: by
reply views Thread by Yann Le Boulanger | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.