🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Regular Expressions: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which regex describes binary strings ending in 01?
  2. Q2. What does ab mean?
  3. Q3. Which operation are regular languages NOT closed under?
  4. Q4. Which regex describes strings with no two consecutive 1s (verified in the demo)?
  5. Q5. Why should you avoid patterns like (a+)+$ on user input?
  6. Q6. Which regex describes all binary strings of even length?
  7. Q7. Using the precedence rules, how is ab + c read?
  8. Q8. Which identity is correct?
  9. Q9. What does this print? (code)
  10. Q10. Arden's theorem gives the solution of R = Q + RP (when P does not contain ε). What is it?