Restructing the source layout to make it nicer.
This commit is contained in:
parent
fff182b457
commit
cc3bb171e1
14 changed files with 166 additions and 33 deletions
27
scratchpad/regtest.cpp
Normal file
27
scratchpad/regtest.cpp
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue