Home > other >  Regex for Gmail email addresses that start with first name followed by a random number
Regex for Gmail email addresses that start with first name followed by a random number

Time:09-02

We are looking for fake accounts in our database and notice that almost all of them follow this pattern for email addresses:

email = firstname   (a random number)   '@gmail.com'

Where firstname is a column in the same table

E.g., if somebody's first name is Lukas then his email address is something like [email protected]

Could you help me with an Sql query containing a regex that gives us the count of these users?

CodePudding user response:

SELECT * FROM users WHERE email LIKE firstname   '%[0-9]@gmail.com'

SQL Fiddle DEMO

  • Related