Shanti,

Try:

/(\W?([\w\s]+)\W+)?(\w[\w\+\-\.]+@[\w\-\.]+)\W?/i
(with "+" signs in mailbox (like user+nospam / domain.com), which are 
invalid)

/(\W?([\w\s]+)\W+)?(\w[\w\\-\.]+@[\w\-\.]+)\W?/i
(without "+" signs)

These should break the addresses down into arrays of matches that you 
can parse into:
display name
mailbox
domain

Let me know if this doesn't pass the tests. Better yet, send me a unit 
test and i'll make it work. :)

also: http://www.zenspider.com/Languages/Ruby/QuickRef.html#11


Michael Fleet
Disinnovate
http://www.disinnovate.com/

-- 
Posted via http://www.ruby-forum.com/.