, STL Perl ( 100 , fooobar.com/questions/94440/...), , -, STL/++, . (, ++/STL , , , , ++, , ). , , , , :
std::basic_string<TCHAR> result;
std::basic_string<TCHAR> line;
std::basic_regex<TCHAR> reProc(_T("^[ \t]*create[ \t]+(view|procedure|proc)+[ \t]+(.+)$"), std::regex::optimize);
std::basic_string<TCHAR> replace = _T("ALTER $1 $2");
do {
std::getline(input, line);
int pos = line.find_first_not_of(_T(" \t"));
if ((pos != std::basic_string<TCHAR>::npos)
&& (_tcsnicmp(line.substr(pos, 6).data(), _T("create"), 6)==0))
result.append(std::regex_replace(line, reProc, replace));
else
result.append(line);
result.append(_T("\n"));
} while (!input.eof());
return result;