Trying to extract Content-Disposition
with c++ <regex>
but all I try are throw regex_error here's code.
"filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)";
"filename=(?:([\\x21-\\x7E&&[^\\Q()<>[]@,;:\\\"/?=\\E]]++)|\"((?:(?:(?:\\r\\n)?[\\t ])+|[^\\r\"\\\\]|\\\\[\\x00-\\x7f])*)\")";
"filename=\"([^\"]+)\""
with this statement
std::string raw("inline;filename="001.jpg"");
try
{
std::regex regex(pattern);
std::smatch match;
if (std::regex_search(raw.begin(), raw.end(), match, regex) && match.size()>1)
{
for (unsigned i=0; i<match.size(); ++i)
{
DEBUG_PRINT(("[%s]", match.str(i).c_str()))
}
}
}
catch (std::regex_error& ex)
{
ERROR_PRINT(("Try [%s]: %s", pattern.c_str(), ex.what()))
}
Aucun commentaire:
Enregistrer un commentaire