tags:

views:

198

answers:

2

I'm looking for a pattern equivalent to \w, and which doesn't match numeric pattern. I cannot use [a-zA-Z] because I would like it to match japanese kanjis as well.

Is there a way to write something like [\w^[0-9]] ? Is there an equivalent of [:alpha:] in python regex?

+9  A: 
[^\W\d]

Throw out non-word characters and throw out digits. Keep the rest.

John Kugelman
pretty cool. I hadn't thought about that.
poulejapon
I honestly bow before your greatness :)
ΤΖΩΤΖΙΟΥ
Excellent. This throws out ALL Unicode digit characters, not just the ASCII [0-9].
John Machin
A: 

Please, read this: http://docs.python.org/library/re.html or just open this page and search for unicode with your browser. Everything you need is explained.

paffnucy
A RTFM advice is generally helpful, so I won't downvote it; however, this one stands out as offtopic-ish for this specific question, compared to the excellent answer by John Kugelman.
ΤΖΩΤΖΙΟΥ