C++에서 std::regex
을 사용하여 문자열에서 트랙 2 데이터를 추출하려고합니다. 코드 조각이 있는데 작동하지 않습니다. regex_match documentation에서C++ std :: regex track 2
std::string buff("this is ateststring;5581123456781323=160710212423468?hjks");
std::regex e (";\d{0,19}=\d{7}\w*\?", std::regex_constants::basic);
if(std::regex_match(buff, e))
{
cout << "Found!";
}
"트랙 2 데이터"는 무엇입니까? 또한 슬래시를 벗어나야합니다. 정규식 엔진 전에 문자열 파서를 가져옵니다. – Cameron