Help with Regular Expressions

Jeff Schwab jeffrey.schwab at rcn.com
Wed Aug 10 10:39:16 EDT 2005


Harlin Seritt wrote:

> I am trying to find some matches and have them put into a list when
> processing is done. I'll use a simple example like email addresses.
> 
> My input is the following:
> wordList = ['myname1', 'myname2 at domain.tld', 'myname3 at domain.tld',
> 'myname4 at domain', 'myname5 at domain.tldx']
> 
> My regular expression would be something like '\w\@\w\.\w' (I realize
> it could and should be more detailed but that's not the point for now).

FYI, matching all compliant email addresses is ridiculously complicated. 
  Before you spend too much time on it, you might want to borrow the 
complete and thoroughly explained example in Regular Expressions (O'Reilly):

	http://www.oreilly.com/catalog/regex/



More information about the Python-list mailing list