Project

General

Profile

Feature #8921

Updated by sawa (Tsuyoshi Sawada) over 4 years ago

=begin 
 It would be really handy if `select` for instance (({select})) could accept a regex. For example 

 ```ruby 
 

  %w[foo bar baz].select(/^ba/) baz].select /^ba/ # => ["bar", "baz"]  
 ``` 

 This  

 I know that this is currently possible via the slightly longer syntax 

 ```ruby 
 

  %w[foo bar baz].select{|i| i[/^ba/]} i[/^ba/] } # => ["bar", "baz"]  
 ``` 
 =end

Back