Regex similar to "^(?u)\w$", but without digits?

Mark Tolonen metolone+gmane at
Sun Apr 12 02:31:51 CEST 2009

"Andreas" <a.pfrengle at> wrote in message 
news:f953c845-3660-4bb5-8ba7-00b93989cd20 at
> Hello,
> I'd like to create a regex that captures any unicode character, but
> not the underscore and the digits 0-9. "^(?u)\w$" captures them also.
> Is there a possibility to restrict an expression like "\w" to "\w
> without [0-9_]"?

'(?u)[^\W0-9_]' removes 0-9_ from \w.


More information about the Python-list mailing list