From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10623 invoked from network); 20 May 2020 19:19:46 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 20 May 2020 19:19:46 -0000 Received: (qmail 9507 invoked by alias); 20 May 2020 19:19:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45865 Received: (qmail 20968 invoked by uid 1010); 20 May 2020 19:19:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-ej1-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25814. spamassassin: 3.4.4. Clear:RC:0(209.85.218.52):SA:0(-1.6/5.0):. Processed in 3.171184 secs); 20 May 2020 19:19:38 -0000 X-Envelope-From: mail@3v1n0.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.218.52 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uU/iG6eo0mu0tfz98HZFLmUCDgnTF1TSA+tBqRmTn1E=; b=M/Me3CQGj1Z+9hu5zUWeQ89oYJ8FZtLHPwHAA6954HeycwjgvgtRmui5KzIyNBpzz5 JfbXm5DxkcLC/v+lotbdb3v7z146AK+W1qbSr7K8cTs0+2o70hza4hZtma8OB3zQPXXk SPqFbfPTiaL5yDUaeVfoTXSsLHhwuN/s/VYVvV4ILptiTN2f771BV3V6AXsctmcTnNd7 FpYIsY6msPtHdru8K9g50m+mAjjiLQW8WTvqp0fM7J3bPl+v9bRjukkFtRGYeXKTOq6B YSwjSw6c9DF6Vor5Tl1jBUjHmlsloxnRlJEahvgLaMtw+G1SrC6ee+oQFgG+j2O8efxb 8FQg== X-Gm-Message-State: AOAM530LCUo0OnEHBtoKyWaLFvx+gwQGp1PJlgGnibDNYz1vot8SnvR+ RQelBJi9hmGyYhNmDzmsWLmYokghRvk= X-Google-Smtp-Source: ABdhPJyyBVog3QM7of9Km4B0A+1u3a42WK19zCYU8frAClDvrgN87AIItayhfKkIYCMy+Ypzyh1sdQ== X-Received: by 2002:a17:906:355b:: with SMTP id s27mr541701eja.436.1590002340483; Wed, 20 May 2020 12:19:00 -0700 (PDT) X-Received: by 2002:a17:906:d86:: with SMTP id m6mr579052eji.434.1590002339164; Wed, 20 May 2020 12:18:59 -0700 (PDT) MIME-Version: 1.0 From: Marco Trevisan Date: Wed, 20 May 2020 21:18:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Handling of escaped plus sign ("+") in regular expressions To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="0000000000009e37b505a61944ff" --0000000000009e37b505a61944ff Content-Type: text/plain; charset="UTF-8" Hi, I've been using zsh to run some local scripts I was normally running with bash and while most of them work as expected, there's a case that weirdly failed to me (using zsh 5.8): [[ +123 =~ ^+[0-9]+$ ]] zsh: failed to compile regex: Invalid preceding regular expression [[ +123 =~ ^\+[0-9]+$ ]] zsh: failed to compile regex: Invalid preceding regular expression The same behavior seems to apply both using RE_MATCH_PCRE and not. As said, both matches correctly using bash. Using something like [[ +123 =~ ^[+][0-9]+$ ]] Works as expected instead. --0000000000009e37b505a61944ff--