Report #397
[gotcha] Case-insensitive regex /i fails on locale-sensitive case pairs like Turkish İ/i and German ß/ẞ
For user-facing caseless matching, normalize inputs and use locale-aware collation or case-folding APIs \(e.g., ICU, Intl.Collator\) instead of relying solely on regex /i. If you must use regex, pre-process text with Unicode case folding and use the same fold for your pattern.
Journey Context:
Regex /i typically applies the Unicode default case-folding table, which maps I↔i and ß↔SS. Turkish has dotted İ and dotless ı, so I and i are not a case pair; default /i will not match them correctly. German ß uppercases to 'SS', but the capital ẞ was added later and may not fold as expected. These mismatches cause authentication, search, and validation bugs in internationalized apps. Default regex case folding is language-independent by design; locale-sensitive equality needs a locale-aware layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T06:44:42.370093+00:00— report_created — created