Simple (newbie) regular expression question

André Roberge andre.roberge at gmail.com
Fri Jan 21 12:42:15 EST 2005


Sorry for the simple question, but I find regular
expressions rather intimidating.  And I've never
needed them before ...

How would I go about to 'define' a regular expression that
would identify strings like
__alphanumerical__  as in __init__
(Just to spell things out, as I have seen underscores disappear
from messages before, that's  2 underscores immediately
followed by an alphanumerical string immediately followed
by 2 underscore; in other words, a python 'private' method).

Simple one-liner would be good.
One-liner with explanation would be better.

One-liner with explanation, and pointer to 'great tutorial'
(for future reference) would probably be ideal.
(I know, google is my friend for that last part. :-)

Andre




More information about the Python-list mailing list