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

Wrong match length? #69

Open
yoyopoleg opened this issue Mar 17, 2021 · 3 comments
Open

Wrong match length? #69

yoyopoleg opened this issue Mar 17, 2021 · 3 comments

Comments

@yoyopoleg
Copy link

yoyopoleg commented Mar 17, 2021

Hi,
I ran into an issue in the following scenario:
pattern = re_compile("{\\w+}");
match_pos = re_matchp(pattern, "{{FW}_TEST", &match_length);

The result is that match_pos==1 (correct), but match_length==5 (incorrect).
I was expecting to get match_pos==0 and match_length==5 --OR-- match_pos=1 and match_length==4.
Tnx
Yair

@xavieryin
Copy link

Looks comparable to #53.
Please also refer to #67, which may help on your case.

@yoyopoleg
Copy link
Author

I tried the code from here: https://github.com/marler8997/tiny-regex-c, no luck :/

marler8997 added a commit to marler8997/tiny-regex-c that referenced this issue Apr 13, 2021
I've added a test for kokke#69.  In order to do this I enhanced the new test3.c file to support patterns that match in the middle of text.
@marler8997
Copy link

marler8997 commented Apr 13, 2021

@yoyopoleg sorry I didn't get notified about your comment 26 days ago, but I just happened to be looking through these issues today. All my changes are on the nocompile branch in my repo, maybe you were using the master branch? I've added your test case here:

https://github.com/marler8997/tiny-regex-c/pull/1/files#diff-17bb50ff94ad23665e8837f348d16688af778a443dda0e15dcb073ce32ead4f8R225

on my branch I get a match position of 1 and a match length of 4 which I believe is what you would expect.

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

3 participants