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