🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.['a', 'b', 'c']
  2. B.['a, b;c']
  3. C.['a', ' b', 'c']
  4. 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 →