Looking at the Javadoc for java.util.regex.Pattern
\p{Alnum}
An alphanumeric character:[\p{IsAlphabetic}\p{IsDigit}]
it appears that every character that matches \p{IsAlphabetic}
should also match \p{Alnum}
However, it does not seem to be the case when the character has an accent. For example, the following assertion fails:
assertEquals("é".matches("\\p{IsAlphabetic}+"),"é".matches("\\p{Alnum}+"));
The same thing happens for other characters with accents such as ą
, ó
, ł
, ź
ż
. All match \p{IsAlphabetic}+
but not \p{Alnum}+
Am I mis-interpreting the Javadoc? Or is this a bug in the documentation or implementation?