Regular Expressions Homework
On Wednesday we will talk about using regular expressions in Python, and then there will be a programming project where you will implement some regular expressions in Python. If you do not have Python 3 installed on your computer, please do so.
Using the regular expression syntax from the book, write regular expressions that recognize the following languages. In all parts, the alphabet is \(\{\texttt{0},\texttt{1}\}\). Turn in a hard copy of this homework in class on Wednesday.
- \(\{w | w\) contains the substring \(\texttt{111} \}\)
- \(\{w |\) the length of \(w\) is at most 5 \(\}\)
- \(\{w | w\) contains an even number of \(\texttt{0}\)s, or contains exactly two \(\texttt{1}\)s \(\}\)
- \(\{w |\) every odd position of \(w\) is a \(\texttt{1} \}\)