Re: Negation of a regular expression in a Pattern

2024-08-12 Thread Raffaello Giulietti
I'm not sure what's unclear in "any character except a, b, or c" or "any character except one in the Greek block". A line terminator is neither 'a' nor 'b' nor 'c', nor is it in the Greek block. Your example works the same in JDK 8, 11, 17, 21, 22, with or without the additional MULTILINE or D

Negation of a regular expression in a Pattern

2024-08-11 Thread Olivier Cailloux
Dear list, The Pattern Javadoc does not specify whether “Any character” includes line terminators in “Any character except a, b, or c (negation)” ([^abc]) or “Any character except one in the Greek block (negation)” (\P{InGreek}), or whether it depends on DOTALL or MULTILINE being set. As a result