Regular Expressions...

Ken D'Ambrosio ken.dambrosio at
Wed Jan 7 23:54:03 CET 2009

Hi, all.  As a recovering Perl guy, I have to admit I don't quite "get"
the re module.  For example, I'd like to do a few things (I'm going to use
phone numbers, 'cause that's what I'm currently dealing with):
12345678900 -- How would I:
- Get just the area code?
- Get just the seven-digit number?

In Perl, I'd so something like
and then I'd have that stuff in $1 and $2, respectively.  But the Python
simply isn't clicking for me.  If anyone could supply concrete examples of
how to do the problem, above, that would be terrific.



More information about the Python-list mailing list