<?php
/*
Дан текст, содержащий в себе email'ы
(адреса почты вроде you+me@some.domain-domain.com ). Напиши скрипт,
выводящий все email, встречающиеся в этом тексте
*/
$regexp = "/\b[a-zA-Z_+-]+(.[a-zA-Z_+-])*@[a-z]+(.[a-z-])*\b/";
$text = "you+me@some.domain-domain.com fdasghdsggaf awes@gmail.com ...@...";
//var_dump($emails);
echo "Emails in text:";
foreach($emails[0] as $email){
echo "\n$email";
}
PD9waHAKCgllcnJvcl9yZXBvcnRpbmcoLTEpOwoKCS8qCgkJ0JTQsNC9INGC0LXQutGB0YIsINGB0L7QtNC10YDQttCw0YnQuNC5INCyINGB0LXQsdC1IGVtYWlsJ9GLIAoJCSjQsNC00YDQtdGB0LAg0L/QvtGH0YLRiyDQstGA0L7QtNC1IHlvdSttZUBzb21lLmRvbWFpbi1kb21haW4uY29tICkuINCd0LDQv9C40YjQuCDRgdC60YDQuNC/0YIsIAoJCdCy0YvQstC+0LTRj9GJ0LjQuSDQstGB0LUgZW1haWwsINCy0YHRgtGA0LXRh9Cw0Y7RidC40LXRgdGPINCyINGN0YLQvtC8INGC0LXQutGB0YLQtQoJKi8KCQoJJHJlZ2V4cCA9ICIvXGJbYS16QS1aXystXSsoLlthLXpBLVpfKy1dKSpAW2Etel0rKC5bYS16LV0pKlxiLyI7CgkkdGV4dCA9ICJ5b3UrbWVAc29tZS5kb21haW4tZG9tYWluLmNvbSBmZGFzZ2hkc2dnYWYgYXdlc0BnbWFpbC5jb20gIC4uLkAuLi4iOwoJCgkkZW1haWxzID0gYXJyYXkoKTsKCXByZWdfbWF0Y2hfYWxsKCRyZWdleHAsICR0ZXh0LCAkZW1haWxzKTsKCQoJLy92YXJfZHVtcCgkZW1haWxzKTsKCQoJZWNobyAiRW1haWxzIGluIHRleHQ6IjsKCWZvcmVhY2goJGVtYWlsc1swXSBhcyAkZW1haWwpewoJCWVjaG8gIlxuJGVtYWlsIjsKCX0=