tiny-regex-c icon indicating copy to clipboard operation
tiny-regex-c copied to clipboard

Cannot match end-of-pattern match

Open perazz opened this issue 3 years ago • 0 comments

Hi and thanks for an amazing library - I'm developing a Fortran port of it here.

I've just found an issue/potential bug with the end-pattern command.

text = "table football" pattern = "l$"

returns index=13, matchlength=3

Here's the sample test program:

#include <stdio.h>
#include <stdlib.h>
#include "re.h"
int main() {

   const char *text = "table football";
   const char *pattern = "l$";
   int index,len;

   index = re_match(pattern, text, &len);

   printf("index=%d len=%d \n",index,len);
}

Tested on Mac with clang 13.1.6

perazz avatar Dec 18 '22 08:12 perazz