# Email validation not working correctly

**URL:** <https://forum.kirupa.com/t/email-validation-not-working-correctly/315192>\
**Category:** Uncategorized\
**Created:** [October 19, 2010, 10:09pm UTC](https://forum.kirupa.com/t/email-validation-not-working-correctly/315192 "2010-10-19T22:09:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)\
**Post date:** [October 19, 2010, 10:09pm UTC](https://forum.kirupa.com/t/email-validation-not-working-correctly/315192/1 "2010-10-19T22:09:44Z")

</div>

Can anyone tell me why it it throws and error and doesn’t validate when the user uses an cap letter in the email? Thanks for all your help!

code:  
public function validateEmail(form\_email\_value:TextField):Boolean  
{  
var email\_exp:RegExp = /^[a-z0-9][-.\_a-z0-9]_@(([a-z0-9][-\_a-z0-9]_.)+[a-z]{2,6}|((25[0-5]|2[0-4]\d|[01]?\d\d?).){3}(25[0-5]|2[0-4]\d|[01]?\d\d?))$/x;  
if( form\_email\_value.text == ‘’ )  
{  
form\_email\_value.text = ‘Email is required.’;  
return false;  
}  
if( !email\_exp.test(form\_email\_value.text) )  
{  
form\_email\_value.text = ‘Email is invalid.’;  
return false;  
}  
return true;  
}
