]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libregex: Implement a subset of the GNU extensions
authorKyle Evans <kevans@FreeBSD.org>
Tue, 4 Aug 2020 02:14:51 +0000 (02:14 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 4 Aug 2020 02:14:51 +0000 (02:14 +0000)
commit18a1e2e9b9f109a78c5a9274e4cfb4777801b4fb
tree520713b46157175eaf322b77ec7fe00979dec3a6
parentba8b64de05d0df84ad9064be950ca38bc7bafe7d
libregex: Implement a subset of the GNU extensions

The entire patch-set is not yet mature enough for commit, but this usable
subset is generally enough for googletest to be happy with and mostly map to
some existing concepts, so they're not as invasive.

The specific changes included here are:

- Branching in BREs with \|
- \w and \W for [[:alnum:]] and [^[:alnum:]] respectively
- \s and \S for [[:space:]] and [^[:space:]] respectively
- Additional quantifiers in BREs, \? and \+ (self-explanatory)

There's some #ifdef'd out work for allowing empty branches as a match-all.
This is a feature that's under assessment... future work will determine
how standard this behavior is and act accordingly.
lib/libc/regex/regcomp.c
lib/libc/regex/regex2.h