I, re . IGNORECASE Case-insensitive matching re. L, re . LOCALE Matches via w, w, b, B, s, S depends on locale re. M, re . MULTILINE Respectively...
View the step-by-step solution to:

Question


Python

1. which provides the common module attributes (flags for most

regex functions)

2. The syntax for the split command is:

re.split(pattern, string, maxsplit=0, flags=0)

Explain the output of the code below and indicate how you would correct it to have the expected results:

re.split('[a-c]', '074a32B16b2012C83c45', re.I)



mod4b.png

mod4b.png

re. I, re . IGNORECASE
Case-insensitive matching
re. L, re . LOCALE
Matches via \w, \w, \b, \B, \s, \S depends on locale
re. M, re . MULTILINE
Respectively causes A and $ to match the beginning
and end of each line in target string rather than strictly
the beginning and end of the entire string itself
re. S, re . DOTALL
The . normally matches any single character except \n;
this flag says . should match them, too
re.X, re . VERBOSE
All whitespace plus # (and all text after it on a single
line) are ignored unless in a character class or back-
slash-escaped, allowing comments and improving
readability

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes