Definition:
Back to the main index of this glossary
>>> import re
>>> list = ['cat', 'car', 'cap', 'cab', 'cad', 'can', 'Cancun', 'Katze', 'Auto', 'Deckel', 'Droschke', 'Flegel', 'Dose', 'Vogel', 'CHAT', 'VOITURE', 'CHAPEAU', 'CABINE', 'DAO', 'BIDON', 'BONBON']
>>> y = re.compile('[cC]an')
>>> for x in list:
... if y.match(x):
... print x
can
Cancun
>>> y = re.compile('[dD].*c.')
>>> for x in list:
... if y.match(x):
... print x
Deckel
Droschke
Back to the main index of this glossary
