New answers tagged

1

As a workaround, you can use Select to filter down the results of ReplaceList to the set you want by using MatchQ and SequencePosition. v = {5, 1, 2, 1, 2, 1, 2, 1, 2, 4, 3, 3, 3, 3, 3, 3, 10}; rl = ReplaceList[v, {Shortest[pre___, 3], Longest[Repeated[Shortest[rep__, 1], {2, Infinity}]], Shortest[inc___, 2]} :> {{pre}, {rep}, {inc}}]; Then ...



Top 50 recent answers are included