How Do You Troubleshoot “AttributeError: module ‘re’ has no attribute ‘IGNORECASE'”?

Problem scenario
When you run your Python program, you get this message: "AttributeError: module 're' has no attribute 'IGNORECASE'"

What should you do to get your program to work correctly?

Solution
Change the name of the program to something different. Do not name your program "re.py". If you use the "import string" and your program is called "re.py", you may get this error.

Leave a comment

Your email address will not be published. Required fields are marked *