🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Regular Expressions: all 10 questions

Quiz: Regular Expressions · Question 6 of 10

Which regex describes all binary strings of even length?

Which regex describes all binary strings of even length?

  1. A.(0+1)*
  2. B.(00)*
  3. C.((0+1)(0+1))*
  4. D.01
Answer & explanation

Correct answer: ((0+1)(0+1))*

Each repetition adds exactly two symbols, so every string has even length.

Can you get the rest right without peeking?

Take the timed Quiz: Regular Expressions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →