File: _bad_cycle.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 (21 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <ctre.hpp>
#include <string_view>

template <typename Subject, typename Pattern> constexpr bool match(Subject input, Pattern) {
	return ctre::regular_expression<Pattern>::match(input);
}

template <typename Subject, typename Pattern> constexpr bool search(Subject input, Pattern) {
	return ctre::regular_expression<Pattern>::search(input);
}

template <typename Subject, typename Pattern> constexpr bool starts_with(Subject input, Pattern) {
	return ctre::regular_expression<Pattern>::starts_with(input);
}

using namespace std::string_view_literals;

static_assert(match("ab"sv, ctre::plus<ctre::select<ctre::string<'a','b'>, ctre::character<'a'>>>()), "(ab|a)+");
// this will need fix in different branch as this is a long standing problem
//static_assert(match("ab"sv, ctre::plus<ctre::select<ctre::character<'a'>, ctre::string<'a','b'>>>()), "(a|ab)+");