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('^c.*')
>>> for x in list:
... if y.match(x):
... print x
...
cat
car
cap
cab
cad
can
>>> y = re.compile('C.*U')
>>> for x in list:
... if y.match(x):
... print x
...
CHAPEAU
>>>
Back to the main index of this glossary
