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].n){1}')
>>> for x in list:
>>> if y.search(x):
>>> print x
can
Cancun
>>> y = re.compile('([cC].n){2}')
>>> for x in list:
>>> if y.search(x):
>>> print x
Cancun
Back to the main index of this glossary
