次の C++ コードがありますが、正常に動作します。
#include <regex>
#include <iostream>
#include <string>
int main () {
std::string str("mymail@yahoo.com;lslsls;myemail@gmail.com");
std::tr1::regex rx("([a-zA-Z0-9_\\.]+@([a-zA-Z0-9\\-]+\\.)+[a-zA-Z]{2,4})");
std::tr1::sregex_iterator first(str.begin(), str.end(), rx);
std::tr1::sregex_iterator last;
for (auto it = first; it != last; ++it)
{
std::cout << "[Email] => " << it->str(1) << std::endl;
}
return 0;
}
ネイティブ ライブラリを使用して C ANSI (*.cpp -> *.c) でこれを取得する簡単な方法はありますか? MS Visual Studio 2010 を使用しています。