JavaScript /\w/iu matches non-ASCII 'ſ' and the Kelvin sign 'K', while /\w/u and /\w/i do not
\w is ASCII-only, but when both the i and u flags are set, Unicode case folding makes it also match U+017F (long s) and U+212A (Kelvin sign), because they fold to s and k: /\w/u.test('\u017f') is false, /\w/i.test('\u017f') is false, but /\w/iu.test('\u017f') is true, and /[\w]/iu.test('\u212a') is true. Validators and sanitizers such as /^\w+$/iu for usernames, slugs or identifiers therefore accept these characters, and 'user_ſ'.replace(/\W/giu, '-') leaves the long s in place while /\W/g replaces it. Meanwhile \w and \b never match letters like é even with u (/^\w+$/u.test('café') is false). Fix: use an explicit class such as [A-Za-z0-9_] for ASCII identifiers (and avoid combining i with u there), or \p{L}/\p{N} with the u flag when you really mean Unicode letters. Node v26.7.0 and Bun 1.3.14 behave identically.