From: "Julian I. Kamil" Date: 2006-03-08T11:33:41+09:00 Subject: Re: Valid email address from CGI input? How about this for checking the grammar: def email_valid?(email_address) email_address =~ /^([a-zA-Z0-9&_?\/`!|#*$^%=~{}+'-]+|"([\x00-\x0C\x0E-\x21\x23-\x5B\x5D-\x7F]|\\[\x00-\x7F])*")(\.([a-zA-Z0-9&_?\/`!|#*$^%=~{}+'-]+|"([\x00-x0C\x0E-\x21\x23-\x5B\x5D-\x7F]|\\[\x00-\x7F])*"))*@([a-zA-Z0-9&_?\/`!|#*$^%=~{}+'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[\x00-\x7F])*\])(\.([a-zA-Z0-9&_?\/`!|#*$^%=~{}+'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[\x00-\x7F])*\]))*$/ end To ensure that it is a working email address, I'd do email verification. Send an email with an activation code to the address, and ask the recipient to 'activate' their email registration. That's how email registration works in Pandora (http://pandora.rubyveil.com/). Best regards, Julian I. Kamil http://pandora.rubyveil.com/ - document publishing and web application platform http://books.rubyveil.com/ - The Ruby Bookshelf