From: Conrad Schneiker/Austin/Contr/IBM Date: 2000-11-13T17:53:30+09:00 Subject: [ruby-talk:6305] Re: Regular expression puzzle: user error or bug? FWIW, I still get the same error when compiling with the added "-O -qmaxmen=8192" (optimization flags for the AIX vac and xlc C compilers), both under AIX 4.3 and AIX 5.0. It looks like configure only tries to do optimized compiles when using gcc; can the above flags be added for the AIX cc compilers? FWIW, I found a somewhat simpler case (#2 below) that produces the regexp stack overflow problem, and what seems to be an equivalent case (#1 below) that doesn't. (Am I missing some subtly of /x mode?) ===================== #!/usr/bin/env ruby puts "----case 1----" p = Regexp.new( " ^(.*/)*(((?:[^.]|[.](?=[^.]*[.]))*))$ ",'x') m = p.match("myfile.txt.sav") m.to_a.each { |x| puts x } puts "----case 2----" p = Regexp.new("^(.*/)*(((?:[^.]|[.](?=[^.]*[.]))*))$",'x') m = p.match("myfile.txt.sav") m.to_a.each { |x| puts x } ===================== ruby 1.6.2 (2000-11-10) [rs6000-aix4.3.2.0] ===================== # ./re_bug.rb ----case 1---- ----case 2---- ./re_bug.rb:13:in `match': Stack overflow in regexp matcher: /^(.*\/)*(((?:[^.\/]|[.](?=[^.\/]*[.]))*))$/i (RegexpError) from ./re_bug.rb:13 ===================== Conrad Schneiker (This note is unofficial and subject to improvement without notice.)