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

re_matchp succeeds only for the first string compared to a pattern #71

Open
MiloDC opened this issue Jun 10, 2021 · 1 comment
Open

Comments

@MiloDC
Copy link

MiloDC commented Jun 10, 2021

re_t myRe = re_compile("^[^=]+=[^=]+$");
int matchLen;
re_matchp(myRe, "operationName=PublishEditMessageClients", &matchLen); (= > -1)
re_matchp(myRe, "operationName=DeleteMessageClients", &matchLen); (= < 0)
re_matchp(myRe, "operationName=PublishEditMessageClients", &matchLen); (= > -1)
re_matchp(myRe, "operationName=PublishDirectMessageClients", &matchLen); (= < 0)

As you can see, only the first string matched against the pattern yields a successful match. Any other string thereafter yields failure. Why is this?

@Amiralgaby
Copy link

in re.c
there is this written

/*
 *   '[abc]'    Character class, match if one of {'a', 'b', 'c'}
 *   '[^abc]'   Inverted class, match if NOT one of {'a', 'b', 'c'} -- NOTE: feature is currently broken!
*/

I see you use inverted class, but i don't realized test if you are right

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