QStringList Core::GetMail(QString from2){ QRegExp rx2("[a-zA-Z]{1}[a-zA-Z\\d\\u002E\\u005F]+@([a-zA-Z]+\\u002E){1,2}((net)|(com)|(org))"); rx2.setMinimal(true); QStringList list2; int pos2 = 0; while ((pos2 = rx2.indexIn(from2, pos2)) != -1) { list2 << rx2.cap(1); pos2 += rx2.matchedLength(); }return list2;}
QString buff2 = "Моё мыло hrom@xakep.ru"; QStringList mail = core.GetMail(buff2); ui->listWidget->addItems(mail);