4 ms·
In Java regexps, the dot matches a code point or an unpaired surrogate, so if you have a proper surrogate pair, the dot matches the whole pair without splitting
by hsivonen 10y ago
In Java regexps, the dot matches a code point or an unpaired surrogate, so if you have a proper surrogate pair, the dot matches the whole pair without splitting it. It does split grapheme clusters.
It's unclear to me what you mean by "Java Characters". A Java char is a UTF-16 code unit, and the java.lang.Character boxes a char (16 bits unsigned). However, since Java 5, java.lang.Character has static methods for astral-aware UTF-16 operations where a code point is a Java int (32 bits signed).
- Manishearth 10y agoYeah, by Character I meant java.lang.Character. > the dot matches the whole pair without splitting it Yeah, so UTF16 in Java is being used as a variable-width encoding. Nice to know.