Regular expression compilation fail in current

Fernando Apesteguía fernape at freebsd.org
Mon Apr 26 13:35:11 UTC 2021


Hi there,

I'm working with this port PR
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255182

and the problem seems to boil down to a regular expression that does
not compile on current but it does in 12.2.

The minimum repro is this one:

#include <regex.h>
#include <stdio.h>

int
main()
{
        regex_t regexp;
        int ret = regcomp(&regexp, "\\s*", REG_EXTENDED | REG_ICASE |
REG_NOSUB);
        if ( ret != 0) {
                printf("regexp compilation failed: %d\n", ret);
        }

        return 0;
}

This one works in 12.2 but fails to compile the regexp in FreeBSD
14.0-CURRENT #11 main-n245984-15221c552b3c with error 5 REG_EESCAPE
`\' applied to unescapable character.

Any help is appreciated.

Thanks!


More information about the freebsd-hackers mailing list