Fix Incorrect Email Records

Asked

Viewed 37 times

0

I need to fix via PHP programming, incorrect emails registered in our database.

Would be emails without domain, with space in any position, with ". @", "@." without "@", any character not allowed in EMAIL.

  • I don’t know if I meant what you want to do, but I imagine it would be pointless to try to correct an email without dominion, precisely because you don’t know which domain. But if you just remove some unwanted characters I think you can do this with regex: https://www.tutorialspoint.com/php/php_regular_expression.htm

  • Hello welcome to Stack Overflow @Alanhenrique, could post what you’ve already tried?

  • Correct, would it delete this record from the database? Which database? It would be better to do it directly in the database. Or Voce wants when to include a wrong record via front, the back already ignore and not even record these records?

  • 1

    PHP already has its own function. Regex + email usually only gives disaster. The rule for email is too big and complex. There are a lot of people who advertise too simplified Regex on websites, get away from it. If you are going to use Regex limit yourself to what you said, check if you have arroba, space, and if you have a point at least right, at most this. It is frustrating for a user to try to register a valid email, and fail. Much worse than passing an invalid (and, anyway, will only know if an email is actually valid when sending successfully).

  • @Bacco could be an answer

  • @Math I’m pretty sure is dup, just not given time to look.

  • @Bacco essa? http://answall.com/q/8067/3117

  • @Math think that: http://answall.com/questions/8134/verifi-se-vari%C3%a1vel-cont%C3%a9m-um-Ndere%C3%a7o-de-email-well-formatted-in-php

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.