Skip to content

Commit

Permalink
added support for complex path names like '5-' or '1741.hr2'
Browse files Browse the repository at this point in the history
  • Loading branch information
subwaystation committed Mar 30, 2020
1 parent d31ed1b commit 1272c15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/subcommand/server_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ namespace odgi {
// const char* pattern1 = R"(/(\w+)/(\d+))";
// const char* pattern1 = R"(/([a-zA-Z]*[0-9]*)/(\d+))";
const char* pattern1 = R"(/(\w*)/(\d+))";
const char* pattern1 = R"(/(\w*.*)/(\d+))";
std::regex regexi1 = std::regex(pattern1);
std::cmatch cm1; // same as std::match_results<const char*> cm;
std::regex_match ("/5-/3",cm1,regexi1);
std::regex_match ("/5-/3",cm1,regexi1); // /1741.hr2/3
std::cout << "the matches were: " << std::endl;
for (unsigned i=0; i<cm1.size(); ++i) {
std::cout << "[" << cm1[i] << "] " << std::endl;
Expand All @@ -88,7 +88,7 @@ namespace odgi {
std::cout << "GOT REQUEST : HELLO WORLD!" << std::endl;
});

svr.Get(R"(/(\w*)/(\d+))", [&](const Request& req, Response& res) {
svr.Get(R"(/(\w*.*)/(\d+))", [&](const Request& req, Response& res) {
/*
for (size_t i = 0; i < req.matches.size(); i++) {
std::cout << req.matches[i] << std::endl;
Expand Down

0 comments on commit 1272c15

Please sign in to comment.