Skip to content

^|$ not handled correctly with REG_NOTBOL #101

@mohd-akram

Description

@mohd-akram

The following:

#include <stdio.h>
#include <tre/tre.h>

int main(void)
{
	regex_t preg;
	tre_regcomp(&preg, "^|$", REG_EXTENDED);
	regmatch_t pmatch[1];
	printf("%d\n", tre_regexec(&preg, "", 1, pmatch, REG_NOTBOL));
	return 0;
}

prints 1. It should print 0 (this is the case in FreeBSD libc and Linux libc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions