I’ve read a great solution for unicode strings here, but I need to check entire string to be letters or spaces or dashes and I can’t think of any solution. The example is not working as I want.
name = u"Василий Соловьев-Седой"
r = re.compile(r'^([\s\-^\W\d_]+)$', re.U)
r.match(name) -> None
[^\W\d_]matches any letter (by matching any alphanumeric character except for digits and underscore).[\s-]of course matches whitespace and dashes.