Skip to content
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

Regex Fails to Match #20

Closed
BenHanson opened this issue Dec 27, 2021 · 3 comments
Closed

Regex Fails to Match #20

BenHanson opened this issue Dec 27, 2021 · 3 comments

Comments

@BenHanson
Copy link

using namespace ctpg;
using namespace ctpg::buffers;

constexpr char number_pattern[] = "0|[1-9][0-9]*";
constexpr ctpg::regex::expr<number_pattern> r;
const bool match = r.match(string_buffer("0"));

match returns false, whereas matching string_buffer("1") returns true.

@peter-winter
Copy link
Owner

peter-winter commented Dec 27, 2021

Unfortuantely confirmed. Easy fix. This is a regression introduced when changed regex parser to have a handcrafted lexer. A corner case was added and no unit test covered it. Already have a fix.

peter-winter added a commit that referenced this issue Dec 27, 2021
@peter-winter
Copy link
Owner

peter-winter commented Dec 27, 2021

Should be fixed now. Added appropriate unit test.

@BenHanson
Copy link
Author

Thanks! Will test now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants