validCharRegex = """[\s\p{gc=L}\d?\-_'.,/@&()!+:]""".toRegex() return name.all { validCharRegex.matches(it.toString()) } // did you notice the change? No? That’s fine
= setOf('-', '\'', '.', ',', '/', '@', '&', '(', ')', '!', '+', ':') return name.all { it.isLetter() || it in validChars } // looks easier, maybe even written by human