compile-time-regular-expressions
compile-time-regular-expressions copied to clipboard
Compile Time Regular Expression in C++
Not sure how to go about this with parsing rules, or for all cases. See: http://www.rexegg.com/regex-optimizations.html#staralt ```c // (greedy) repeat of alternation (?:a|b...)* -> a*(?:b...+a*)* template constexpr CTRE_FORCE_INLINE R evaluate(const...
### Using redundant include guards to minimize the compilation time C Preprocessor inclusions could explode the compilation time (even with pragma once!) The basic idea comes from an old, dusty...
`0?1?2?3?4?5?6?7?8?9?`
Adds functionality to analyze the minimum and maximum # of characters a regex may match.
Hello, I've tried to use CTRE in my project, but MSVC was running out of memory. - My project/branch: https://github.com/bstaletic/ycmd/tree/cxx17 - Azure log: https://dev.azure.com/borisstaletic/3ce92110-caa5-4c49-b8c3-44a433da676b/_apis/build/builds/634/logs/78 Both the debug and the release...
``` #include using namespace std::literals; static constexpr auto pattern = ctll::fixed_string{R"(([^.]|[.])*(^|[^{])(\{\{)*\{[^{}]*)"}; constexpr bool check(std::string_view sv) noexcept { return ctre::match(sv); } static_assert(check("{"sv)); // ok static_assert(check("{{{"sv)); // ok static_assert(!check("abc{{{"sv)); // failure int...
Regex engines traditionally have quadratic or higher rather than linear complexity. Therefore it's important to asses their performance. Would you consider adding comparisons to other widespread regex engines? I would...
Placeholder for my idea how to make the LL parser much quicker. Stay tuned!
Hi Hana, this is the first attempt.