[Tutor] Letters & Digits

Lee-Shanok, Bruce Bruce.Lee-Shanok@cognos.com
Fri, 16 Nov 2001 17:00:56 -0500


I'm currently doing some manual parsing of a string in Python, and I need to
find a way to make sure it consists only of a particular group of
characters. 

I may also later need to ensure that it does not include any of a number of
characters. 

I know there are constants in Python that define all the digits, letters,
printable characters, etc. What I'm wondering is if there's a clean and easy
way to test each character in a string to see if they match (or do not
match) characters from those lists. So far the best I've been able to come
up with are sequences of for loops, but I'm imagining there must be a better
way.

Cheers,
Bruce

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender by
e-mail promptly that you have done so.  Thank You.