[Tutor] Finding all the letters in a string?
Eric Lake
ericlake at ubuntu.com
Tue Sep 18 02:20:15 CEST 2007
This seems to work to get out the alpha-numeric characters.
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
import re
pat = re.compile('\w')
lst = []
chars = '@*1&^$&*^@$g*(&@2$*(&$@c(*&3*(&c^&%4&^%'
lst = pat.findall(chars)
for x in lst:
print x,
--
Thanks
Eric Lake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/tutor/attachments/20070917/e73cf93d/attachment.pgp
More information about the Tutor
mailing list