Never try to read regexp, it's write only 2017-12-16 9:09 GMT+01:00 Stephane Ducasse <stepharo.self@gmail.com>:
ouaaahhhhhh ;) My problem was that I had complex lines as elements. and I will not be able to remember and express anything with regex
On Tue, Dec 12, 2017 at 4:36 PM, Martin Dias <tinchodias@gmail.com> wrote:
If your input was a string instead of a list of lines, you had:
'[^4]*4|.+' asRegex matchesIn: '1234123123456'
"an OrderedCollection('1234' '1231234' '56')"
MartÃn
On Tue, Dec 12, 2017 at 9:33 AM, Stephane Ducasse < stepharo.self@gmail.com> wrote:
Thanks sean. I will build it because for example I had list of lines and I needed to split the input depending on patterns inside the lines.... and sadly this was not for an advent of code.
Rmoders suggested aggregateRuns: splitOn: but this is not the same.
Stef
On Tue, Dec 12, 2017 at 2:33 AM, Sean P. DeNigris <
sean@clipperadams.com>
wrote:
Stephane Ducasse-3 wrote
#(1 2 3 4 1 2 3 5 6 ) consumeUntil: [:each | each = 4)
{#(1 2 3 4) . #( 1 2 3 5 6 )}
The shortest kernel thing I could come up with took two steps: `{ #(1 2 3 4 1 2 3 5 6 ) copyUpThrough: 4. #(1 2 3 4 1 2 3 5 6 ) copyAfter: 4 }`. The splitting messages seem to all eat the separator.
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html