From 825f84c77e7e6f31d5f0fc9dd636198477c9a357 Mon Sep 17 00:00:00 2001 From: Phil Pennock Date: Thu, 15 Jun 2017 16:40:50 -0400 Subject: 41308 (tweaked): behaviour of PCRE with NUL bytes --- Test/V07pcre.ztst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Test/V07pcre.ztst') diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst index ad1770712..7426e7bf8 100644 --- a/Test/V07pcre.ztst +++ b/Test/V07pcre.ztst @@ -131,6 +131,12 @@ >78884; ZPCRE_OP: 25 30 >90210; ZPCRE_OP: 31 36 +# Embedded NULs allowed in plaintext, but not in RE (although \0 as two-chars allowed) + [[ $'a\0bc\0d' =~ '^(a\0.)(.+)$' ]] + print "${#MATCH}; ${#match[1]}; ${#match[2]}" +0:ensure ASCII NUL passes in and out of matched plaintext +>6; 3; 3 + # Subshell because crash on failure ( setopt re_match_pcre [[ test.txt =~ '^(.*_)?(test)' ]] -- cgit 1.4.1