I'm very new to excel VBA macro and I just want to right an excel formula to validate an email which has been customized. For an example the email that I'm finding, must end up with '@gmail.com' and must reject following mail items;
- [no word]@gmail.com
- [space]@gmail.com
- [email protected][any word]
- [email protected]
- xxx@gmail/.com
- xxx@gmail/com
To validate the email address I have written a regex as follows;
^([a-zA-Z0-9_\-\.]+)@(\b(gmail)\b)+(\.\b(com)\b)$
I tried different ways to apply these regex in to an excel formula like =MATCH but it did not work. I need to complete this email validation using an excel formula only.
I'm grateful if someone can help me on this?