Forum: Ruby Re: Odd behavior of String#scan

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2005-12-22 00:11
(Received via mailing list)
> > to:
> >     But this does two operations where it seems like one should
> > suffice. Does someone know of a way to do this in a single
> operation?
> I would suggest:
>    'abcSTARTdef,ghi,jkl,ENDmno'.match(/START(.*)END/)[1].split(',')
> I don't know of a way to accomplish it in one step.

I don't think it's possible without lookbehind assertions.  Maybe
Oniguruma supports this.


This topic is locked and can not be replied to.