Restructing the source layout to make it nicer.

This commit is contained in:
Zed A. Shaw 2024-09-10 21:17:15 -04:00
parent fff182b457
commit cc3bb171e1
14 changed files with 166 additions and 33 deletions

27
scratchpad/regtest.cpp Normal file
View file

@ -0,0 +1,27 @@
#include <fmt/core.h>
#include <regex>
#include <string>
using namespace fmt;
using namespace std;
int main(int argc, char *argv[]) {
smatch matches;
if(argc != 3) {
println("USAGE: regtest <regex> <line>");
} else {
regex to_test(argv[1]);
string line(argv[2]);
if(regex_match(line, matches, to_test)) {
println("MATCHED: ");
for(auto &match : matches) {
println("\t{}", match.str());
}
} else {
println("NO MATCH");
}
}
}