- 
    Enhancement 
- 
    Resolution: Fixed
- 
     P4 P4
- 
    20
- 
        b22
- 
        generic
- 
        generic
                    Issue JDK-8280101 requests that String.split should keep the delimiter for grouped regex. This is a non-negligible behaviorally incompatible change and would probably break much existing client code.
A safer alternative is to add API points to both String and Pattern, like
String.splitWithDelimiters(String regex, int limit);
Pattern.splitWithDelimiters(CharSequence input, int limit);
Adding this functionality outside the JDK is somehow more complicated than necessary, so it makes sense to add it in the JDK itself.
A safer alternative is to add API points to both String and Pattern, like
String.splitWithDelimiters(String regex, int limit);
Pattern.splitWithDelimiters(CharSequence input, int limit);
Adding this functionality outside the JDK is somehow more complicated than necessary, so it makes sense to add it in the JDK itself.
- csr for
- 
                    JDK-8305488 Add split() variants that keep the delimiters to String and j.u.r.Pattern -           
- Closed
 
-         
- duplicates
- 
                    JDK-8280101 in String.split grouped regex should keep the delimiter -           
- Closed
 
-         
               There are no Sub-Tasks for this issue.
    
 
        