On Sun, Sep 22, 2019 at 9:02 PM Allodoxaphobia <[email protected]> wrote:
>
> In moving a bash ver. 4.3.48 (Ubuntu) program to a bash ver. 5.0.11
> (FreeBSD) environment I encountered either a bug, a quirk, or
> an undocumented feature.
>
> I was using a null regexp as a "match for anything" case
This behavior depends on the OS's underlying regex implementation.
For example BSD says (man 3 regex, under IMPLEMENTATION CHOICES):
An empty parenthesized subexpression, `()', is legal and matches an empty
(sub)string. An empty string is not a legal RE.