regular expression unicode character class trouble

Diez B. Roggisch deets at nospam.web.de
Mon Sep 5 05:42:00 EDT 2005


Steven Bethard wrote:
> I'd use something like r"[^_\d\W]", that is, all things that are neither 
> underscores, digits or non-alphas.  In action:
> 
> py> re.findall(r'[^_\d\W]+', '42badger100x__xxA1BC')
> ['badger', 'x', 'xxA', 'BC']
> 
> HTH,

Seems so, great!

Diez



More information about the Python-list mailing list