\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm,tabu,enumerate,tikz}
\usetikzlibrary{automata,positioning}
\usepackage[margin=1in]{geometry}

\title{\vspace{-3ex}\bf RegEx Crossword Puzzles \footnote{All puzzles taken from regexcrossword.com} \\[2ex]
\rm\normalsize CS 311, Fall 2015}
\date{}
\author{}

\begin{document}
\maketitle
\begin{center}
{\bf Reference\\}
\begin{tabular}{| c | l |}
    \hline
    .   & Accepts any single character \\ \hline
    A\textbar B & Alternate, accepts either A or B\\ \hline
    \textasciicircum A & Lines that begin with A \\ \hline
    A\$ & Ends with A \\ \hline
    A*  & Zero or more repetitiion of A \\ \hline
    A+  & One or more repitition of A \\ \hline
    A?  & Zero or one instance of A \\ \hline
    A\{3\} & Exactly 3 As \\ \hline
    A\{3,\} & Three or more As \\ \hline
    A\{3,5\} & Three, four, or five As \\ \hline
    [ABC] & Range of characters (A or B or C) \\ \hline
    [\textasciicircum ABC] & Not A or B or C \\ \hline
    [A-F] & Any character in the range A through F \\ \hline
    \textbackslash d & Accepts any single digit (0 - 9)\\ \hline
    \textbackslash s & Accepts any whitespace \\ \hline
\end{tabular}
\end{center}

\paragraph{Exercise 1} 
\begin{center}
\begin{tikzpicture}
    \draw (0,0) grid (2,2);
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            [\textasciicircum SPEAK]+
            }] at (0.5,4.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            EP\textbar IP\textbar EF
            }] at (1.5,4.4) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            HE\textbar LL\textbar O+
            }] at (-2.5,1.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [PLEASE]+
            }] at (-2.5,0.5) {};
\end{tikzpicture}
\end{center}

\newpage
\paragraph{Exercise 2} 
\begin{center}
\begin{tikzpicture}
    \draw (0,0) grid (2,2);
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            \textbackslash d [2480]
            }] at (0.5,3.6) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            56\textbar 94\textbar 73
            }] at (1.5,3.6) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            18\textbar 19\textbar 20
            }] at (-2,1.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [6789]\textbackslash d
            }] at (-2,0.5) {};
\end{tikzpicture}
\end{center}

\paragraph{Exercise 3} 
\begin{center}
\begin{tikzpicture}
    \draw (0,0) grid (3,2);
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            UB\textbar IE\textbar AW
            }] at (0.5,4.3) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            [TUBE]*
            }] at (1.5,3.8) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            [BORF].
            }] at (2.5,3.8) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [NOTAD]*
            }] at (-2.5,1.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            WEL\textbar BAL\textbar EAR
            }] at (-3.5,0.5) {};
\end{tikzpicture}
\end{center}

\paragraph{Exercise 4} 
\begin{center}
\begin{tikzpicture}
    \draw (0,0) grid (3,3);
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            [JUNDT]*
            }] at (0.5,4.9) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            APA\textbar OPI\textbar OLK
            }] at (1.5,6) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex,rotate=-90]right:
            (NA\textbar FE\textbar HE) [CV]
            }] at (2.5,6.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [DEF][MNO]*
            }] at (-2.8,2.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [\textasciicircum DJNU]P[ABC]
            }] at (-3.1,1.5) {};
    \node[anchor=south,label={[label distance=0cm,text depth=-1ex]right:
            [ICAN]*
            }] at (-2,0.5) {};
\end{tikzpicture}
\end{center}


\end{document}
