libc: regex: partial revert of r368358Part of the libregex functionality leaked into the tests it shares withthe standard regex(3). Introduce a P flag to set the REG_POSIX cflag toindicate that l
libc: regex: partial revert of r368358Part of the libregex functionality leaked into the tests it shares withthe standard regex(3). Introduce a P flag to set the REG_POSIX cflag toindicate that libc regex should effectively do nothing while libregex shouldspecifically run it in non-extended mode.This unbreaks the libc/regex test run.Reported by: Jenkins
show more ...
libregex: implement \b and \B (word boundary, not word boundary)This is the last of the needed GNU expressions before we can unleash bsdgrepby default. \b is effectively an agnostic equivalent of
libregex: implement \b and \B (word boundary, not word boundary)This is the last of the needed GNU expressions before we can unleash bsdgrepby default. \b is effectively an agnostic equivalent of \< and \>, while\B will match every space that isn't making a transition fromnonchar -> char or char -> nonchar.
regex(3): Interpret many escaped ordinary characters as EESCAPEIn IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows forany character to be escaped, but "ORD_CHAR preceded by an un
regex(3): Interpret many escaped ordinary characters as EESCAPEIn IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows forany character to be escaped, but "ORD_CHAR preceded by an unescaped<backslash> character [gives undefined results]".Historically, we've interpreted an escaped ordinary character as theordinary character itself. This becomes problematic when some extensionsgive special meanings to an otherwise ordinary character(e.g. GNU's \b, \s, \w), meaning we may have two different validinterpretations of the same sequence.To make this easier to deal with and given that the standard calls thisundefined, we should throw an error (EESCAPE) if we run into this scenarioto ease transition into a state where some escaped ordinaries are blessedwith a special meaning -- it will either error out or have extendedbehavior, rather than have two entirely different versions of undefinedbehavior that leave the consumer of regex(3) guessing as to what behaviorwill be used or leaving them with false impressions.This change bumps the symbol version of regcomp to FBSD_1.6 and provides theold escape semantics for legacy applications, just in case one has an olderapplication that would immediately turn into a pumpkin because of anextraneous escape that's embedded or otherwise critical to its operation.This is the final piece needed before enhancing libregex with GNU extensionsand flipping the switch on bsdgrep.[1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/PR: 229925 (exp-run, courtesy of antoine)Differential Revision: https://reviews.freebsd.org/D10510
regex(3): Handle invalid {} constructs consistently and adjust testsCurrently, regex(3) exhibits the following wrong behavior as demonstratedwith sed: - echo "a{1,2,3}b" | sed -r "s/{/_/" (1
regex(3): Handle invalid {} constructs consistently and adjust testsCurrently, regex(3) exhibits the following wrong behavior as demonstratedwith sed: - echo "a{1,2,3}b" | sed -r "s/{/_/" (1) - echo "a{1,2,3}b" | sed "s/\}/_/" (2) - echo "a{1,2,3}b" | sed -r "s/{}/_/" (3)Cases (1) and (3) should throw errors but they actually succeed, and (2)throws an error when it should match the literal '}'. The correct behaviorwas decided by comparing to the behavior with the equivalent BRE (1)(3) orERE (2) and consulting POSIX, along with some reasonable evaluation.Tests were also adjusted/added accordingly.PR: 166861Reviewed by: emaste, ngie, pfgApproved by: emaste (mentor)MFC after: neverDifferential Revision: https://reviews.freebsd.org/D10315
Add regression test for recent regex(3) breakageBREs recently became prematurely sensitive to the branching operator, whichoutright broke expressions that used it instead of failing silently. Test
Add regression test for recent regex(3) breakageBREs recently became prematurely sensitive to the branching operator, whichoutright broke expressions that used it instead of failing silently. Testthat \| is matching a literal | for the time being.Reviewed by: cem, emaste, ngieApproved by: emaste (mentor)Differential Revision: https://reviews.freebsd.org/D11577
Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,minus the vendor MakefilesProvide directions for how to bootstrap the vendor sources inFREEBSD-upgradeMFC after 2 weeks
Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,minus the vendor MakefilesProvide directions for how to bootstrap the vendor sources inFREEBSD-upgradeMFC after 2 weeksDiscussed with: rpauloSponsored by: EMC / Isilon Storage Division