Words are detected by spaces, punctuation, and existing camelCase/PascalCase boundaries (so “helloWorld” splits into “hello” and “World”). Joined cases (camelCase, snake_case, kebab-case, CONSTANT_CASE, PascalCase) strip punctuation; spaced cases (UPPERCASE, lowercase, Title, Sentence, aLtErNaTiNg) preserve it.