473,384 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,384 software developers and data experts.

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 2796
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pascal | last post by:
Hello, I've a function like this: def myfunction(data, verbose = False): dothis... if verbose: print 'I do this' dothisother if verbose: print 'I do this other' ...
3
by: chemag | last post by:
Hi, I'm having some problems with basic RE in python. I was wondering whether somebody could provide a hint on what's going wrong with the following script. Comments are included. TIA....
0
by: Adam H. Pendleton | last post by:
When running a "VACUUM VERBOSE" query using PQsendQuery, PQconsumeInput, and PQisBusy, all the "INFO:" output from the "VACUUM VERBOSE" command is printed on the terminal, and is not available...
9
by: Eric Lilja | last post by:
Hello, I'm a novice C++ programmer and now I have the task of converting a number of C++ functions to C. Some of the functions I'm converting takes a parameter of type reference-to-std::string...
0
by: Ananda Sim | last post by:
Hi All, The RegularExpressionValidator control seems to be simple enough - put in a regexpr and it works. So I put in yes in lower case but I want case insensitive match. So I put in yes/i...
3
by: mast2as | last post by:
In the same vein as the topic that I started on exception handling ;-) .... If I have read (not all of them though) the documents that you guys pointed me to, the try/throw/catch mechanism should...
1
by: brainstorm | last post by:
Hi, I'm using Borland Delphi .NET 2005 and I've got a problem using Regular Expressions. But the RegExOptions do not work properly. My Replace - function looks like: function...
12
by: Les Caudle | last post by:
I've got a .NET 2.0 app that works quite well on all of my test boxes. However, at the client's site, it crashes with 'has encounted a problem' basic dialog. No useful info. I've yet to see...
0
by: Yann Le Boulanger | last post by:
Hi all, I have a problem with regex , utf-8 chars and IGNORECASE <_sre.SRE_Match object at 0x2aaaaed0c100> Here everything is ok.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.