Exercises for Lecture 7

Regular Expressions

Consider the regular expression (a|b)+0(1|2|3|4)*(a|b) over the alphabet {a,b,0,1,2,3,4,5}
  1. Which of the following strings are matched by the regular expression?
    1. a04321b
    2. a0135a
    3. 022b
    4. a042
  2. Draw a finite state automaton for the regular expression.

DTD

  1. Browse through the DTD for XHTML. Try to answer the following questions:

  2. Write a DTD schema for your own XML version of the weblog.

Tips