i want to take only mail address which not contains ‘xxx-‘ at the start and ‘@test.com’ at the end of the mail string.
Here my code :
->where('email', 'regexp', "/^(([email protected]).)*$/i")
Here i take only email where not contains ‘test.com’ at the end.
I want to not take email where the start is ‘xxx-‘ too. Anyone know how to do this ?
Thank you !
You may use this regex with 2 negative lookahead assertions (rules):
^(?!xxx-)(?![^@][email protected]\.com$)[^@][email protected][^@]+$