-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valid regex does not match #257
Comments
Yep, here's a bug. I can reduce it to #include "ctll/fixed_string.hpp"
#include "ctre.hpp"
static constexpr auto ptv_regex = ctll::fixed_string(
"(?:a|ab)?"
);
bool x()
{
auto found = ctre::match<ptv_regex>( "ab" );
return found;
} |
Thanks for the minimisation, it seems to me there is a deeper problem, and I'm currently don't know how to fix it. Will try to look at it soon. |
It seems to related when you have a common prefix in selection inside a cycle. |
I am not an expert on how this library implements matching, but it seems to me that there are two factors:
while (less_than_or_infinite<B>(i)) {
auto inner_result = evaluate(..., ctll::list<Content..., end_cycle_mark>());
// ... match Tail if inner_result matches
} The problem is that, at some point, the expression I am writing this because I have also implemented compile-time regular expression matching as a hobby-project (inspired by this library, of course) and I have come across the same bug in my code. The solution that i have found involves using a callback function that calls |
Hello. I have the following regex:
which I try to match using:
On regex101.com, this regex matches for the python, PCRE and PCRE2 regex "engines", so I believe the regex is valid and OK. With the CTRE library (version 3.6 from vcpkg and that which is available as trunk on compiler explorer today), it does not match.
Sorry that I don't have the knowledge to try and pinpoint the problem. Just thought I would report it.
The text was updated successfully, but these errors were encountered: