← Quiz: Regular Expressions: all 10 questions
Quiz: Regular Expressions · Question 4 of 10
Which regex describes strings with no two consecutive 1s (verified in the demo)?
Which regex describes strings with no two consecutive 1s (verified in the demo)?
- A.(0+1)11(0+1)
- B.(0 + 10)*(ε + 1)
- C.01
- D.(01)*
Answer & explanation
Correct answer: (0 + 10)*(ε + 1)
Every 1 (except possibly the last symbol) is followed by a 0.
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 →