← Quiz: Regular Expressions in Python: all 10 questions
Quiz: Regular Expressions in Python · Question 10 of 10
What does re.split(r"[,;]\s", "a, b;c") return?
What does re.split(r"[,;]\s*", "a, b;c") return?
- A.['a', 'b', 'c']
- B.['a, b;c']
- C.['a', ' b', 'c']
- D.['a', ',', 'b', ';', 'c']
Answer & explanation
Correct answer: ['a', 'b', 'c']
It splits at a comma or semicolon plus any spaces after it.
Can you get the rest right without peeking?
Take the timed Quiz: Regular Expressions in Python quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →