Sad sam probao nesto, izgleda da std::regex ne podrzava "lookaround".
Kôd:
#include <iostream>
#include <string>
#include <regex>
int main()
{
try
{
std::string str = "Pera kojot, super genije.";
std::regex pattern("(?<![a-zA-Z])[a-zA-Z]+(?![a-zA-Z])");
const std::sregex_token_iterator end;
std::sregex_token_iterator ti(str.begin(), str.end(), pattern);
for(; ti != end; ++ti)
{
std::cout << (*ti) << std::endl;
}
}
catch(const std::exception& e)
{
std::cout << e.what() << std::endl;
}
std::cin.ignore();
return 0;
}
out:
Citat:
regex_error(error_syntax)
|
Ne mogu da verujem! Koji su ga djavo stavljali u STL?