En Thu, 08 Feb 2007 23:32:50 -0300, Sick Monkey <[EMAIL PROTECTED]>  
escribió:

> db = {'[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none',  
> '[EMAIL PROTECTED]':'none',
> '[EMAIL PROTECTED]':'none',}
>
> And I want to pull out all of the "gmail.com" addresses..  How would I do
> this?
>
> NOTE:  I already have a regular expression to search for this, but I feel
> that looping over a dictionary is not very efficient.

for key in db:
   if domain_regexp.search(key):
     print "horray"

Iterating over the dictionary keys should be rather efficient. timeit and  
see if it worths to make it more complex.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to