Upgrade Regex with a tester() method?

Ben Evans benjamin.john.evans at gmail.com
Fri Jan 18 18:58:56 PST 2013

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?



On Fri, Jan 4, 2013 at 7:07 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> Seems a nice "point lambdafication" suggestion.  (The naming convention
> we've been using as "asPredicate()".)
> Regex is one of those areas where we wanted to do more with lambdafication,
> but just didn't have the time to work through it.  If you want to suggest
> more...
> On 1/3/2013 9:49 AM, Ben Evans wrote:
>> Hi,
>> I've been thinking about places to include lambdas outside of the
>> collections libs.
>> I've had a look through the archives but can't find any obvious
>> discussion of this topic, so am posting here. If there are threads
>> I've missed - please point me at them.
>> What about upgrading java.util.regex.Pattern to include this method
>> (and / or similar):
>> public Predicate<String> tester(){
>>      return s -> this.matcher(s).find();
>> }
>> When writing articles and labs code which uses lambdas, I've found
>> myself writing helper classes to achieve a similar effect, and it
>> occurred to me that this could be a better way to solve the problem.
>> Thanks,
>> Ben

More information about the lambda-dev mailing list