re-internal.rb
changeset 60 68d664c204d2
parent 58 f516892da470
equal deleted inserted replaced
59:b64e876832cc 60:68d664c204d2
     9 	string = "a" * i
     9 	string = "a" * i
    10 
    10 
    11 	#create a new regular expression based on current value of i
    11 	#create a new regular expression based on current value of i
    12 	re = Regexp.new(/((a?){#{i}})(a{#{i}})/)
    12 	re = Regexp.new(/((a?){#{i}})(a{#{i}})/)
    13 
    13 
    14 	if re.match(string)
    14         re.match(string)
    15 		puts "matched string  a * #{i} with regex #{re}"
    15 	#if re.match(string)
    16 	else
    16 	#	puts "matched string  a * #{i} with regex #{re}"
    17 		puts "unmatched string a * #{i} with regex #{re}"
    17 	#else
    18 	end
    18 	#	puts "unmatched string a * #{i} with regex #{re}"
       
    19 	#end
    19 	
    20 	
    20 	puts "in = #{(Time.now - start_time) * 1000} milliseconds"
    21   puts "#{i} %.5f" % (Time.now - start_time)
    21 end
    22 end