progs/catastrophic.rb
changeset 558 c9da2c4586f2
parent 474 331b2c9e525f
child 563 6bb70f562d37
--- a/progs/catastrophic.rb	Sun Sep 23 09:04:24 2018 +0100
+++ b/progs/catastrophic.rb	Mon Sep 24 11:05:39 2018 +0100
@@ -1,4 +1,15 @@
+# A case of catastrophic backtracking in Ruby
+#---------------------------------------------
+#
+# regex: (a?){n} a{n}
+# strings: aa...
+#
 # example provided by Daniel Baldwin
+#
+# call with:
+#
+#   > ruby catastrophic.rb
+#
 
 nums = (1..1000)