Binary file hw07.pdf has changed
--- a/hw07.tex Sun Nov 11 17:28:11 2012 +0000
+++ b/hw07.tex Wed Nov 14 00:02:38 2012 +0000
@@ -57,7 +57,14 @@
\texttt{The trainer trains the student team}
\end{center}
+\item {\bf (Optional)} The task is to match strings where the letters are in alphabetical order---for example,
+\texttt{abcfjz} would pass, but \texttt{acb} would not. Whitespace should be ignored---for example
+\texttt{ab c d} should pass. The point is to try to get the regular expression as short as possible!
+See:
+\begin{center}
+\url{http://callumacrae.github.com/regex-tuesday/challenge11.html}
+\end{center}
\end{enumerate}
\end{document}
--- a/re-internal.rb Sun Nov 11 17:28:11 2012 +0000
+++ b/re-internal.rb Wed Nov 14 00:02:38 2012 +0000
@@ -11,11 +11,12 @@
#create a new regular expression based on current value of i
re = Regexp.new(/((a?){#{i}})(a{#{i}})/)
- if re.match(string)
- puts "matched string a * #{i} with regex #{re}"
- else
- puts "unmatched string a * #{i} with regex #{re}"
- end
+ re.match(string)
+ #if re.match(string)
+ # puts "matched string a * #{i} with regex #{re}"
+ #else
+ # puts "unmatched string a * #{i} with regex #{re}"
+ #end
- puts "in = #{(Time.now - start_time) * 1000} milliseconds"
+ puts "#{i} %.5f" % (Time.now - start_time)
end
Binary file topics.pdf has changed
--- a/topics.tex Sun Nov 11 17:28:11 2012 +0000
+++ b/topics.tex Wed Nov 14 00:02:38 2012 +0000
@@ -17,19 +17,20 @@
\begin{itemize}
\item What is a language?
-\item concatenation of two sets of string
+\item concatenation of two sets of strings
\item power of a set of strings
\end{itemize}
\section{Regular Expressions}
\begin{itemize}
+\item definition of regular expressions
\item What is the language of a regular expression?
\item When are two regular expressions are equal?
\item {\it nullable}, {\it der}, {\it zeroable}, {\it rev}
\item induction principle of regular expressions
\item tokens, maximal munch rule
-\item ``negative'' regular expression
+\item regular expression for complement language
\item tokenisation
\end{itemize}