-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
17
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
In Perl split a grouped regex i.e. split(/(\.)/, $string) split the String while keeping the delimeter in the resulting array.
split(/(,)/, "a,b,12,45,7:8") gives -> ["a", ",", "b", ",", "12", ",", "45",",","7:8"]
This is possible in Java but with lookahead and lookbehind: (https://www.baeldung.com/java-split-string-keep-delimiters)
In Perl split a grouped regex i.e. split(/(\.)/, $string) split the String while keeping the delimeter in the resulting array.
split(/(,)/, "a,b,12,45,7:8") gives -> ["a", ",", "b", ",", "12", ",", "45",",","7:8"]
This is possible in Java but with lookahead and lookbehind: (https://www.baeldung.com/java-split-string-keep-delimiters)
- duplicates
-
JDK-8305486 Add split() variants that keep the delimiters to String and j.u.r.Pattern
-
- Resolved
-