So, I'm trying to determine if someone is using a temporary email made by our system. If a user tries to log in using a social account (Twitter / Facebook) and they deny access to email, I generate an email for our system, which is AccountID@facebook.com or AccountID@twitter.com , so an example will be 123456789 @facebook. com This is a temporary email until the user enters a real email address. I am trying to compare this with a regex.
if (preg_match("/^[0-9]@twitter.com/", Auth::user()->email, $matches)) {
}
However, I think my regex is wrong. How to check if string format is N Number of digits followed by @ twitter.com or @ facebook.com
CMOS source
share