Newbie question on Re module

A.M. Kuchling akuchlin at ute.mems-exchange.org
Fri Jan 3 14:02:11 EST 2003


In article <Xns92F582EB0133EjslmAAearthlinknet at 130.133.1.4>,
	Josh wrote:
>  I know I can match all binaries groups and then remove them from the list. 
> My question is how can I do it the other way round, meaning how can I match 
> all non binaries groups in the first place.

groups = [...big list...]
non_bin_groups = filter(lambda name: not name.endswith('binaries'),
                        groups)

Much easier than struggling with regexes... 

--amk                                                             (www.amk.ca)
SHYLOCK: Fast bind, fast find.
      -- _The Merchant of Venice_, II, v




More information about the Python-list mailing list