Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cassert>
- #include <filesystem>
- #include <fstream>
- #include <iostream>
- #include <regex>
- #include <sstream>
- #include <string>
- #include <vector>
- using namespace std;
- using filesystem::path;
- path operator""_p(const char* data, std::size_t sz) {
- return path(data, data + sz);
- }
- int main() {
- static regex inc_path(R"/(\s*#\s*include\s*<([^>]*)>\s*)/");
- smatch m;
- string line = "#include <std1.h>"s;
- if (regex_match(line, m, inc_path)) {
- path f_name = string(m[1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment