Title: E-Mail validation works wrong
Last modified: August 21, 2016

---

# E-Mail validation works wrong

 *  Resolved [mdidesign](https://wordpress.org/support/users/mdidesign/)
 * (@mdidesign)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/e-mail-validation-works-wrong/)
 * Hello,
 * when typing in a mailadress with a “-” in the domain-name like [xxx@this-is-a-test.org](https://wordpress.org/support/topic/e-mail-validation-works-wrong/xxx@this-is-a-test.org?output_format=md)
   this plugin does not work.
 * [just-a-test@xxxxxx.org](https://wordpress.org/support/topic/e-mail-validation-works-wrong/just-a-test@xxxxxx.org?output_format=md)
   works fine, but when putting a “-” to the domain it does not.
 * In wp-comment-validation.php there is this string:
 * (VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]
   +(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/))
 * I guess here is something missing?
 * Could you fix that?
 * [https://wordpress.org/plugins/wp-comment-validation/](https://wordpress.org/plugins/wp-comment-validation/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ajay Sharma](https://wordpress.org/support/users/ajay3085006/)
 * (@ajay3085006)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/e-mail-validation-works-wrong/#post-4682905)
 * Hello mdidesign,
 * I just read your post,
    for allowing – in domain name please use this regex .`(
   VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9-]
   +(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/))`
 * now email are allowed with – within them.
    Thanks for posting query.

Viewing 1 replies (of 1 total)

The topic ‘E-Mail validation works wrong’ is closed to new replies.

 * ![](https://ps.w.org/wp-comment-validation/assets/icon-128x128.png?rev=1171824)
 * [wp comment validation](https://wordpress.org/plugins/wp-comment-validation/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-comment-validation/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-comment-validation/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-comment-validation/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-comment-validation/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-comment-validation/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ajay Sharma](https://wordpress.org/support/users/ajay3085006/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/e-mail-validation-works-wrong/#post-4682905)
 * Status: resolved