I need to remove all mails which include firstname and lastname in mail, for example:

if mail looks like:

john13@example.com -> remove [email protected] ->remove [email protected]>remove [email protected]>remove

if mail looks like: [email protected]> stay [email protected]> stay etc

now it removing only mails like a:

[email protected] [email protected] but [email protected] is still in table

can this be somehow covered by regular expressions?


oh ok, try this

YourModel::whereRaw('email REGEXP concat("(", firstname, "|", lastname, ")+.*@")')->get();

probably that's it :) now I need to remove mails and will be good :D Thanks so much :)

Please sign in or create an account to participate in this conversation.