troubleshooting Question

How do I verify the username of an email address in MYSQL using the following rules?

Avatar of richardsimnett
richardsimnett asked on
MySQL Server
3 Comments1 Solution603 ViewsLast Modified:
Hello,
I am trying to validate a list of email addresses in our database based upon a set of rules provided to us by the ISP. All the rules deal only with the localpart (username) portion of the email address. I imagine it has to be done with regex but I have no idea how to use regular expressions, so help in this matter is greatly appreciated.

what I have so far is this:

update emaillist set status = 'I' where substring(email,0,instr(email,'@') - 1) REGEXP <regex with rules here>

The rules are as follows:

1. The local part of the email address cannot be less than 3 characters nor greater than 16.
2. The local part of the email address cannot start with numbers.
3. The local part of the email address cannot contain any punctuation at all. no periods, dashes, hyphens, etc.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros