From: Joseph Jones Date: 2015-12-17T21:13:10-07:00 Subject: [ruby-core:72334] [Ruby trunk - Feature #11100] Permit multiple captures with String[Regexp, ...] --567387d6_7de67713_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 10, 2015 at 16:35= :21 MST, djberg96=40gmail.com wrote:Issue =2311100 has been updated by Da= niel Berger.I support allowing multiple captures. I think the =5B1,2=5D s= yntax is the most intuitive.----------------------------------------=46ea= ture =2311100: Permit multiple captures with String=5BRegexp, ...=5Dhttps= ://bugs.ruby-lang.org/issues/11100=23change-55454* Author: D.E. Akers* St= atus: Open* Priority: Normal* Assignee: ---------------------------------= -------I propose that if we are able to conveniently grab one capture wit= h this method, we ought to be able to grab more than one. Still, there ar= e some caveats worth considering:* It should return an array, but every o= ther =60=23=5B=5D=60 variant returns a string or =60nil=60.* Should the a= rgument be an array, or should the method be variadic=3F - Array argument= looks a little =22noisy=22=3F =60'123abc'=5B/(=5Cd+)(=5Cw+)/, =5B2, 1=5D= =5D=60 - Variadic method requires intrusive modification of internal call= s to =60rb=5Fstr=5Fsubpat()=60.* Complementary =60=23=5B=5D=3D=60 would b= e crpytic, overly complex, and likely go unused, but not adding it would = break the symmetry.I realize this is essentially an outline of why not to= implement this feature, but I figured I'd toss it out there for feedback= . Thoughts=3F---=46iles--------------------------------string=5Fslice=5Fm= any=5Fcaptures.patch (906 Bytes)-- https://bugs.ruby-lang.org/ --567387d6_7de67713_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 10, 2015 at 16:35:21 MST, djberg96=40gmail.com wrote:
Issue =2311100 has been updat= ed by Daniel Berger.


I support allowing multiple capture= s. I think the =5B1,2=5D syntax is the most intuitive.

-------= ---------------------------------
=46eature =2311100: Permit multipl= e captures with String=5BRegexp, ...=5D
https://bugs.ruby-lang.org/i= ssues/11100=23change-55454

* Author: D.E. Akers
* Status:= Open
* Priority: Normal
* Assignee:
--------------------= --------------------
I propose that if we are able to conveniently g= rab one capture with this method, we ought to be able to grab more than o= ne. Still, there are some caveats worth considering:

* It shou= ld return an array, but every other =60=23=5B=5D=60 variant returns a str= ing or =60nil=60.
* Should the argument be an array, or should the m= ethod be variadic=3F
- Array argument looks a little =22noisy=22=3F= =60'123abc'=5B/(=5Cd+)(=5Cw+)/, =5B2, 1=5D=5D=60
- Variadic metho= d requires intrusive modification of internal calls to =60rb=5Fstr=5Fsubp= at()=60.
* Complementary =60=23=5B=5D=3D=60 would be crpytic, overly= complex, and likely go unused, but not adding it would break the symmetr= y.

I realize this is essentially an outline of why not to impl= ement this feature, but I figured I'd toss it out there for feedback. Tho= ughts=3F

---=46iles--------------------------------
strin= g=5Fslice=5Fmany=5Fcaptures.patch (906 Bytes)


--
h= ttps://bugs.ruby-lang.org/
--567387d6_7de67713_16c--