You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following small example shows that this regex is not handled correctly.
#include<stdio.h>#include<tre/tre.h>intmain() {
regex_tpreg;
intret;
tre_regcomp(&preg, "\\ba", REG_EXTENDED);
ret=tre_regexec(&preg, "this is a word", 0, NULL, 0);
printf("return value for \\ba is %d\n", ret);
tre_regcomp(&preg, "^a", REG_EXTENDED);
ret=tre_regexec(&preg, "this is a word", 0, NULL, 0);
printf("return value for ^a is %d\n", ret);
tre_regcomp(&preg, "(^|\\b)a", REG_EXTENDED);
ret=tre_regexec(&preg, "this is a word", 0, NULL, 0);
printf("return value for (^|\\b)a is %d\n", ret);
tre_regcomp(&preg, "(\\b|^)a", REG_EXTENDED);
ret=tre_regexec(&preg, "this is a word", 0, NULL, 0);
printf("return value for (\\b|^)a is %d\n", ret);
}
euler:/tmp $ gcc -o testtre testtre.c -ltre
euler:/tmp $ ./testtre
return value for \ba is 0
return value for ^a is 1
return value for (^|\b)a is 1
return value for (\b|^)a is 0
I'm using libtre version 0.8.0-6 on Debian, which is based on the 0.8.0 release.
Best wishes,
Julian
The text was updated successfully, but these errors were encountered:
juliangilbey
changed the title
Regex (^|\b) is not handled correctly, but (^|\b) is
Regex (^|\b) is not handled correctly, but (\b|^) is
Nov 30, 2020
The following small example shows that this regex is not handled correctly.
I'm using libtre version 0.8.0-6 on Debian, which is based on the 0.8.0 release.
Best wishes,
Julian
The text was updated successfully, but these errors were encountered: