progs/re.rb
changeset 411 1aec0e1fda86
parent 410 3e1b8266ea65
child 412 1cef3924f7a2
--- a/progs/re.rb	Sun Aug 21 00:43:31 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# provided by Daniel Baldwin
-
-nums = (1..1000)
-
-#iterate through the nums 1-100
-nums.each do |i|
-
-	start_time = Time.now
-	string = "a" * i
-	re_str = "a?" * i + "+" + "a" * i
-	#create a new regular expression based on current value of i
-	
-	re = Regexp.new(re_str)
-
-        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 "#{i} %.5f" % (Time.now - start_time)
-end