From 4650dd34ab2913b885e9cc59366cdb9ab49a437b Mon Sep 17 00:00:00 2001 From: Nathan Dench Date: Tue, 11 May 2021 10:09:26 +1000 Subject: [PATCH] Add capturing back into to AddressHelper::convertFormulaToA1 --- src/PhpSpreadsheet/Cell/AddressHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Cell/AddressHelper.php b/src/PhpSpreadsheet/Cell/AddressHelper.php index 0dabc6e0..f9177808 100644 --- a/src/PhpSpreadsheet/Cell/AddressHelper.php +++ b/src/PhpSpreadsheet/Cell/AddressHelper.php @@ -72,7 +72,7 @@ class AddressHelper foreach ($temp as &$value) { // Only replace in alternate array entries (i.e. non-quoted blocks) if ($key = !$key) { - preg_match_all('/(?:R(?:(?:\[-?\d*\])|(?:\d*))?)(?:C(?:(?:\[-?\d*\])|(?:\d*))?)/i', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE); + preg_match_all('/(R((?:\[-?\d*\])|(?:\d*))?)(C((?:\[-?\d*\])|(?:\d*))?)/i', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE); // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way // through the formula from left to right. Reversing means that we work right to left.through // the formula