9three Posted October 25, 2009 Share Posted October 25, 2009 Hi, I was wondering how I would be able to grab characters from an email all the way up to the @ symbol? Example: email@example.com The result I would need would be: foo1 This would match what I'm looking for? /^[A-Z0-9._%-]+@$/i And then do something like: preg_match('/^[A-Z0-9._%-]+@$/i', $email, $match); echo $match;// Prints everything up to the @ Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.