RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern

2023-04-03 Thread Raffaello Giulietti
Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in addition to the substrings returned by current `split()` variants, also return the delimiters matching the regular expression. - Commit messages: - 8305486: Add split() variants that keep the delimiters to S

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern

2023-04-03 Thread Raffaello Giulietti
On Mon, 3 Apr 2023 17:43:55 GMT, Raffaello Giulietti wrote: > Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Also see [here](https://

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern

2023-04-06 Thread Roger Riggs
On Mon, 3 Apr 2023 17:43:55 GMT, Raffaello Giulietti wrote: > Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. src/java.base/share/class

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern

2023-04-07 Thread Raffaello Giulietti
On Mon, 3 Apr 2023 17:43:55 GMT, Raffaello Giulietti wrote: > Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. @RogerRiggs All concerns

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-07 Thread Raffaello Giulietti
> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Raffaello Giulietti has updated the pull request incrementally with one additional comm

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-10 Thread Roger Riggs
On Fri, 7 Apr 2023 14:11:36 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giulietti

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-11 Thread Raffaello Giulietti
On Mon, 10 Apr 2023 14:00:46 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8305486: Add split() variants that keep the delimiters to String and >> j.u.r.Pattern >> Restored original Jav

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-11 Thread Raffaello Giulietti
On Mon, 10 Apr 2023 14:14:54 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8305486: Add split() variants that keep the delimiters to String and >> j.u.r.Pattern >> Restored original Jav

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v3]

2023-04-11 Thread Raffaello Giulietti
> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Raffaello Giulietti has updated the pull request incrementally with one additional comm

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-11 Thread Raffaello Giulietti
On Mon, 10 Apr 2023 14:35:06 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8305486: Add split() variants that keep the delimiters to String and >> j.u.r.Pattern >> Restored original Jav

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v4]

2023-04-11 Thread Raffaello Giulietti
> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Raffaello Giulietti has updated the pull request incrementally with one additional comm

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-11 Thread Roger Riggs
On Tue, 11 Apr 2023 08:58:36 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/java/lang/String.java line 3302: >> >>> 3300: * >>> 3301: * 0 >>> 3302: * {@code { "b", "o", "", "o", ":::and::f", "o", "", "o" >>> }} >> >> These cases might be a bit easier to

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v4]

2023-04-11 Thread Roger Riggs
On Tue, 11 Apr 2023 09:14:29 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giuliett

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]

2023-04-12 Thread Raffaello Giulietti
On Tue, 11 Apr 2023 20:42:38 GMT, Roger Riggs wrote: >> The choice of multi-character delimiter is deliberate, to show that the >> regex really absorbs all the delimiter characters. >> The `":+"` examples are followed by the `"o"` examples, where the delimiters >> are single characters. > > I u

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-04-24 Thread Raffaello Giulietti
> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Raffaello Giulietti has updated the pull request incrementally with one additional comm

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Jaikiran Pai
On Mon, 24 Apr 2023 12:18:55 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giuliett

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Raffaello Giulietti
On Mon, 8 May 2023 11:55:05 GMT, Jaikiran Pai wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Small optimization in private split(). >> Added tests to compare String and Pattern implementations, in particu

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Jaikiran Pai
On Mon, 24 Apr 2023 12:18:55 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giuliett

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Raffaello Giulietti
On Mon, 8 May 2023 12:08:06 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/java/lang/String.java line 3254: >> >>> 3252: * If the limit is positive then the pattern will >>> be applied >>> 3253: *at most limit - 1 times, the array's >>> length will be >>> 325

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Jaikiran Pai
On Mon, 24 Apr 2023 12:18:55 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giuliett

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Jaikiran Pai
On Mon, 8 May 2023 12:15:57 GMT, Raffaello Giulietti wrote: >> The HTML named entity `·` is rendered correctly by the javadoc >> tool. However, IntelliJ IDEA currently does not recognize it >> (https://youtrack.jetbrains.com/issue/IDEA-316843). I could replace it by >> the equivalent `·`, whi

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Jaikiran Pai
On Mon, 8 May 2023 12:20:25 GMT, Jaikiran Pai wrote: >> Alternatively, one could remove the multiplication sign altogether... > >> I could replace it by the equivalent `·` > > I just locally used this as a replacement to `centerdot` and regenerated the > javadocs. The generated javadoc HTML loo

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Raffaello Giulietti
On Mon, 8 May 2023 12:23:27 GMT, Jaikiran Pai wrote: >>> I could replace it by the equivalent `·` >> >> I just locally used this as a replacement to `centerdot` and regenerated the >> javadocs. The generated javadoc HTML looks the same like the screenshot in >> my previous comment. >> >> My o

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Roger Riggs
On Mon, 8 May 2023 12:30:45 GMT, Raffaello Giulietti wrote: >>> Alternatively, one could remove the multiplication sign altogether... >> >> Do you mean rewording it to something like: >> >>> the array's length will be no greater than 2 times limit - 1 > > I mean the usual juxtaposition in math

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Roger Riggs
On Mon, 8 May 2023 13:45:53 GMT, Roger Riggs wrote: >> I mean the usual juxtaposition in maths to signify multiplication, like in >> _a_ _b_ instead of _a_·_b_ >> >>> the array's length will be no greater than 2 _limit_ - 1 > > I would replace center-dot with either with "times" or "*" as being

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v6]

2023-05-08 Thread Raffaello Giulietti
> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in > addition to the substrings returned by current `split()` variants, also > return the delimiters matching the regular expression. Raffaello Giulietti has updated the pull request incrementally with one additional comm

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v5]

2023-05-08 Thread Raffaello Giulietti
On Mon, 8 May 2023 13:50:19 GMT, Roger Riggs wrote: >> I would replace center-dot with either with "times" or "*" as being easier >> to read and more familiar in the javadoc. > > In java.lang.Math I see both "*" and "×" used to indicate > multiplication. Just replaced with `×`, as used in the

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v6]

2023-05-08 Thread Roger Riggs
On Mon, 8 May 2023 14:04:27 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giulietti

Re: RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v6]

2023-05-08 Thread Jaikiran Pai
On Mon, 8 May 2023 14:04:27 GMT, Raffaello Giulietti wrote: >> Add `split()` overloads to `String` and `java.util.regex.Pattern` that, in >> addition to the substrings returned by current `split()` variants, also >> return the delimiters matching the regular expression. > > Raffaello Giulietti