Upgrade Regex with a tester() method?
paul.sandoz at oracle.com
Mon Jan 21 01:19:14 PST 2013
On Jan 19, 2013, at 3:58 AM, Ben Evans <benjamin.john.evans at gmail.com> wrote:
> Hi Brian,
> The other possible point lambdafication for java.util.regex that I've
> come up with is
> Stream<CharSequence> splitAsStream(CharSequence input)
> Returns a stream consisting of the input sequence split around matches
> of this pattern.
> What do people think of that as an idea?
I like it. Implementation-wise this requires an Iterator over the matches.
One could do:
But it is tricker to the "remove all empty strings at the end" as supported by the split that takes a limit parameter of a 0 value.
More information about the lambda-dev