CaseFolding

How an ignore-case contains, starts-with or ends-with compares letter case, on every backend: both texts after Unicode's simple case folding, character by character, with no language's own rules and nothing a store's locale, collation or version decides.

The folding is one table, case-folding.txt beside this class: the classes of the characters that fold together (CaseFolding.txt's C and S entries), generated by scripts/case-folding.mjs from a Unicode version it names, and never edited. So s, S and ſ meet, as do σ, Σ and ς wherever they stand, μ and µ, Dž and its two other cases, k and the Kelvin sign. İ (U+0130) folds with no other character, so İstanbul does not start with is, nor ı (U+0131) meet i.

The in-memory reference compares folded texts. A store matches the regular expression pattern builds from the operand, case-sensitively, so its own case functions, which follow its locale or its version, decide nothing. So does a compiler of SQL outside Wow's modules that must mean what the query protocol means, as the analytics catalog's dataset definitions do (#7071): pattern is the one entry for it; the rest is Wow's own.

Functions

Link copied to clipboard

The characters codePoint folds together with, itself among them, ascending; null when it folds with none.

Link copied to clipboard

text folded: each character as the first of its class, so two texts fold equal when their letters do.

Link copied to clipboard
fun pattern(operand: String): String

The regular expression that matches, case-sensitively, exactly the texts that fold equal to operand: each of its characters that folds together with others as the bracket class of them all ([Ssſ]), any other as itself, with a backslash before it when it is ASCII punctuation. No anchor: the caller adds its own.