[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regular Expression matching operation =~
From: |
Grisha Levit |
Subject: |
Re: Regular Expression matching operation =~ |
Date: |
Mon, 23 Sep 2019 01:01:35 -0400 |
On Sun, Sep 22, 2019 at 9:02 PM Allodoxaphobia <trepidation@example.net> 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.