RFR: 574: git-info should use info from commit notifications [v3]
Magnus Ihse Bursie
ihse at openjdk.java.net
Tue Feb 16 07:46:33 UTC 2021
On Mon, 15 Feb 2021 18:09:04 GMT, Erik Helin <ehelin at openjdk.org> wrote:
>> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>> Add test for reviewUrl parsing
> forge/src/main/java/org/openjdk/skara/forge/HostedRepository.java line 103:
>> 101: */
>> 103: var pattern = Pattern.compile("### Review[^]]*]\\((.*)\\)");
> Do you need to use `Pattern.DOTALL` here? As in `Pattern.compile("### Review[^]]*]\((.*)\)", Pattern.DOTALL);` ? I'm thinking about the `.*` handling `\n`.
As you can see from the test, this works just fine. :-)
The `DOTALL` flag only applies to the dot `.`. I'm searching for "anything but ]", `[^]]` which also includes line terminators. And the URL (that I match with `.*`) should of course not have line breaks in it.
More information about the skara-dev