From: shyouhei@...
Date: 2016-03-03T04:38:28+00:00
Subject: [ruby-core:74102] [Ruby trunk Feature#8921] Allow select, reject,	etc to accept a regex

Issue #8921 has been updated by Shyouhei Urabe.


Do you still need this? We now have grep_v which resembles your reject example.

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

* 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>