Regular Expressions Pop Quiz
Part A
For each of the following regular expressions, circle all of the strings from the choices that it would match.
- ^a+
- abcba
- bcdef
- bcaca
- bbacb
- aacbb
- b+ac?
- abcba
- bcdef
- bcaca
- bbacb
- aacbb
- ^a\w*a$
- abcba
- bcdef
- bcaca
- bbacb
- aacbb
- a\w?a
- abcba
- bcdef
- bcaca
- bbacb
- aacbb
Part B
The following two strings are codons for the protein Asparagine, abbreviated as N.
'aat', 'aac'
Write a regular expression that matches those two, and only those two, strings. You can assume that your regular expression will be matched only on strings that are three letters long, containing only the letters 'g', 't', 'a', and 'c'.