From b8a96d789253c91093476f898611d5903799e84e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 31 Aug 2017 03:43:11 +0300 Subject: Fix regex_replace_ex() to ignore unmatched sub-expression references --- tests/regex/testscript | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/regex/testscript b/tests/regex/testscript index 1af604c..8291f36 100644 --- a/tests/regex/testscript +++ b/tests/regex/testscript @@ -21,7 +21,10 @@ : capture : - $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '$1$10' >aj + { + $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '$1$10' >aj : matched + $* a '(a)|(b)' '$1$2$3' >a : unmatched + } } : perl-escape @@ -33,7 +36,10 @@ : capture : - $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '\1\10' >aa0 + { + $* abcdefghij '(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)' '\1\10' >aa0 : matched + $* a '(a)|(b)' '\1\2\3' >a : unmatched + } : upper : -- cgit v1.1