Issue #8921 has been updated by Kyle Decot.


Has there been any thought on this?



----------------------------------------
Feature #8921: Allow select, reject, etc to accept a regex
https://bugs.ruby-lang.org/issues/8921#change-57065

* Author: Kyle Decot
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
=begin
It would be really handy if for instance (({select})) could accept a regex. For example

 %w[foo bar baz].select /^ba/ # ["bar", "baz"] 

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

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



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>