Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::smatch match;
- std::string B = "B";
- std::array<std::regex,2> regex = {
- std::regex("(A)"),
- std::regex("(B)")
- };
- for(auto it = regex.begin(); it != regex.end(); ++it)
- if(std::regex_match(B, match, *it) && match.size() > 0)
- std::cout << match.str(1) << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement