Regular Expressions/DFAs/NDFAs Practice Questions

- L = { w an element of {a,b,c}* : w is either a, b, or c }.
- L = { w an element of {a,d}* : w is the string dad }
- L = { w an element of {c}* : w is a string containing any number of c's }.
- L = { w an element of {a,b,c}* : w can be either abccb, abcbc, aacbcb, or aacbbc }.
- L = { w an element of {b,c}* : w does not contain both b's and c's }.
- L = { w an element of {a,b}* : w is of even length }.
- L = { w an element of {a,b,c}* : w begins with ab which is then followed by one or more b's then cc then three or more a's }.
- L = { w an element of {a,b,c}* : w contains baab as a substring }.
- L = { w an element of {a,b}* : w contains at least one pair of consecutive a's }.
- L = { w an element of {a,b}* : w consists of all strings that begin with an even number of a's followed by an odd number of b's. }
- L = { w an element of {a,b}* : w has both baa and aaba as a substring }.
- L = { w an element of {a,b}* : w has an odd number of b's }.
- L = { w an element of {a,b,c}* : the number of a's in w is divisible by 3 }.
- L = { w an element of {a,b}* : w contains no more than one pair of consecutive a's }.
- L = { w an element of {a,b}* : w contains neither aa nor bb as a substring }.
- L = { w an element of {a,b}* : w does not contain the substring aaa }.
- L = { w an element of {a,b}* : w contains EXACTLY ONE occurence of the substring aaa }.
- L = { w an element of {a,b}* : every pair of adjacent a's appears before any pair of adjacent b's }.
- L = { w an element of {a,b}* : w does not contain the substring bab }.

- L = a*b
- L = (a|b)b*a
- L = (ac)*b | acd*
- L = (ab | aabb)*
- L = {w an element of {a,b}*: w always contains at least 1 a and 1 b}
- L = {w an element of {a,b}*: w contains the substring abab}
- L = {w an element of {a,b}*: each 'a' in w is preceded by a 'b'}
- L = {w an element of {a,b,c}*: w contains 1 b and an odd number of c's}
- L = {w an element of {a,b,c}*: w contains an even number of b's and an even number of c's}
- L = {w an element of {a,b}* : the number of a's in w is congruent to 0 (mod 4)}
- L = {w an element of {a,b}* : w contains both ab and ba as substrings }
- L = {w an element of {a,b}* : the number of a's in w is congruent to the number of b's in w (modulo 2) }
- L = {w an element of {a,b}* : w does not contain either aa or bb }
- L = (a|b)*(ba)
- L = (a|b)*(baaa)
- L = (bb|bba)*(a)

- L = (ab|aab)
- L = (a|b)*aabab
- L = (ac|aca)*
- L = a*(ab)*a*
- L = ((ab|aab)*a*)*
- L = { w an element of {a,b}* : w contains the pattern bb or the pattern bab }
- L = ((a*b*a*)*b)*
- L = (ba|b)*|(bb|a)*

### Technical Support: Help

Modified: Thu Jan 6 13:34:49 PST 2000 by J. N. Tremblay

Modified: 2001 by M. Weston