Answer the question
In order to leave comments, you need to log in
C++ regex error when declaring in h file. How to decide?
I have a program, I want to declare a library regex object, but I do it in a .h file. It doesn't work. And in the main function everything is ok.
Here is the code:
#include "Parsing.h"
Parsing::Parsing(){
}
void Parsing::Parse(){
Html = req.buffer;
if (regex_match(Html.c_str(), result, regular)){
cout << "true!";
}
}
#pragma once
#include <regex>
#include "Request.h"
class Parsing{
public:
Parsing();
Request req;
void Parse();
string Html = "";
cmatch result;
regex regular("");
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question