Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Regular Expressions in Python Introduction to Regular Expressions Negation

walter fernandez
walter fernandez
4,992 Points

hi, what is re.verbose for? thanks

hi, what is re.verbose for? thanks

3 Answers

Steven Parker
Steven Parker
231,269 Points

Using re.verbose (or "re.X") allows you to write nicer-looking and are more readable expressions by adding comments and spreading things out with whitespace and new lines.

For more details, see the online documentation.

walter fernandez
walter fernandez
4,992 Points

and what is re.MULTILINE FOR?

Steven Parker
Steven Parker
231,269 Points

That has to do with whether the begin and end tokens refer to lines or the whole string. You'll find that on the same documentation page I provided the link for.