On Fri, 20 Aug 2021 11:56:08 GMT, Pavel Rappo <[email protected]> wrote:
>> That said a stricter regexp (unless I'm mistaken) could be: >> `^[a-zA-Z][a-zA-Z0-9+-.]*:.+$` >> [ from RFC 2396: scheme = alpha *( alpha | digit | "+" | "-" | >> "." ) ] > > My only concerns were correctness and code reuse. Using an API doesn't > require one to read through RFC. I'd argue for simply adding `ftp:` as an additional condition (unless there's other interesting URI schemes I'm not thinking of?). If a regex is to be used, I agree it should be much stricter (and defined in a constant, so that the `Pattern` doesn't need to be compiled on each invocation?). ------------- PR: https://git.openjdk.java.net/jdk/pull/5198
