diff --git a/Classes/PHPExcel/Calculation.php b/Classes/PHPExcel/Calculation.php index 0478b05d..60dca6ef 100644 --- a/Classes/PHPExcel/Calculation.php +++ b/Classes/PHPExcel/Calculation.php @@ -40,9 +40,9 @@ if (!defined('CALCULATION_REGEXP_CELLREF')) { // Test for support of \P (multibyte options) in PCRE if(defined('PREG_BAD_UTF8_ERROR')) { // Cell reference (cell or range of cells, with or without a sheet reference) - define('CALCULATION_REGEXP_CELLREF','((([^,!]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)'); + define('CALCULATION_REGEXP_CELLREF','((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})'); // Named Range of cells - define('CALCULATION_REGEXP_NAMEDRANGE','((([^,!]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9]*)'); + define('CALCULATION_REGEXP_NAMEDRANGE','((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9]*)'); } else { // Cell reference (cell or range of cells, with or without a sheet reference) define('CALCULATION_REGEXP_CELLREF','(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)');