I need some help with php regex, I want to “split” email address “johndoe@example.com” to “johndoe” and “@example.com”
Until now I have this: preg_match('/<?([^<]+?)@/', 'johndoe@example.com', $matches);
And I get Array ( [0] => johndoe@ [1] => johndoe)
So how I need to change regex?
1 Answer