This code is used to validate mail format: This is normal regular
expression format
=begin
validates_format_of :email,
:if => Proc.new { |employee| employee.email.nil?
employee.email.empty?},
:with => /^[A-Z0-9._%-]+@([A-Z0-9-]+.)+[A-Z]
{2,4}$/i,
:message => “must be a valid email address”
=end
contact email: [email protected]
On 26 May 2011 10:48, bdeveloper01 [email protected] wrote:
:message => "must be a valid email address"
=end
Is there a question there?
If it is not working it is probably because it is commented out.
Colin
On 26 May 2011 10:48, bdeveloper01 [email protected] wrote:
This code is used to validate mail format: This is normal regular
expression format
:with => /^[A-Z0-9._%-]+@([A-Z0-9-]+.)+[A-Z]
{2,4}$/i,
What’s the question? And where have you gotten this regex from…
firstly I’m confused why you’re only allowing capital letters,
full-stops and underscores… it’s certainly possible to have a valid
email address with different characters than that.