Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unicode friendly alphabetic pattern for python regex?

Tags:

python

regex

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?

like image 628
fulmicoton Avatar asked Dec 23 '22 10:12

fulmicoton


1 Answers

[^\W\d]

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

like image 196
John Kugelman Avatar answered Jan 19 '23 23:01

John Kugelman