kokke / kokke/tiny-regex-c

Wrong match length?

Open
#69 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.5k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported example with re_compile and re_matchp, checking both match_pos and match_length for the pattern and input shown. Compare the result with the two expected outcomes in the report and document which matching semantics should apply before adding a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.