File: future.cpp

package info (click to toggle)
ctre 3.9.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,084 kB
  • sloc: cpp: 80,452; makefile: 135; javascript: 69; python: 31
file content (15 lines) | stat: -rw-r--r-- 275 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <ctre.hpp>
#include <optional>
#include <iostream>

std::string match(std::string_view sv) {
	if (auto match = ctre::match<"[a-z]+">(sv); match) {
		return match.to_string();
	} else {
		return "not_match";
	}
} 

int main() {
	std::cout << match("hello") << "\n";
}