Issue #6853 has been reported by zhangb (Bushi Zhang).

----------------------------------------
Bug #6853: Regular Expression Bug
https://bugs.ruby-lang.org/issues/6853

Author: zhangb (Bushi Zhang)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]


I'm getting a seg fault with the following code:

  resources :products, :only => %w(show) do
    collection do
      get ':user_platform/:app_guid(/:template)', :action => 'index', :as => '',
        :defaults => { :template => 'appwall' },
        :constraints => { :user_platform => /[a-z][a-z0-9-\s]+/i, :app_guid => /[0-9a-z\-\.]+/i }
    end
  end

The culprit is the line with :constraints, specifically the trailing '-' in user_platform. 

I tested the expression on Rubular and it's not a problem. Older versions of ruby will return a warning but won't crash. Removing the '-' fixes the problem. 


-- 
http://bugs.ruby-lang.org/