By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,200 Members | 1,703 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,200 IT Pros & Developers. It's quick & easy.

re.IGNORECASE and re.VERBOSE

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.