File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/PhpSpreadsheet/Worksheet Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,12 @@ public static function validateCellRange($cellRange): string
65
65
[$ worksheet , $ addressRange ] = Worksheet::extractSheetTitle ($ cellRange , true );
66
66
67
67
// Convert Column ranges like 'A:C' to 'A1:C1048576'
68
- $ addressRange = (string ) preg_replace ('/^([A-Z]+):([A-Z]+)$/ ' , '${1}1:${2}1048576 ' , $ addressRange );
69
- // Convert Row ranges like '1:3' to 'A1:XFD3'
70
- $ addressRange = (string ) preg_replace ('/^( \\d+):( \\d+)$/ ' , 'A${1}:XFD${2} ' , $ addressRange );
68
+ // or Row ranges like '1:3' to 'A1:XFD3'
69
+ $ addressRange = (string ) preg_replace (
70
+ ['/^([A-Z]+):([A-Z]+)$/i ' , '/^( \\d+):( \\d+)$/ ' ],
71
+ ['${1}1:${2}1048576 ' , 'A${1}:XFD${2} ' ],
72
+ $ addressRange
73
+ );
71
74
72
75
return empty ($ worksheet ) ? strtoupper ($ addressRange ) : $ worksheet . '! ' . strtoupper ($ addressRange );
73
76
}
You can’t perform that action at this time.
0 commit comments