corrected regex to fit all given enclosures. Added test for single enclosure

This commit is contained in:
Susann Sgorzaly
2018-02-26 08:55:51 +01:00
parent aaefe2a480
commit 68b849a37b
2 changed files with 11 additions and 1 deletions

View File

@@ -556,7 +556,7 @@ class Csv {
$this->_detect_and_remove_sep_row_from_data($data);
$pattern = sprintf('/("[^%s]*")|[^%s]*/i', $this->enclosure, $this->enclosure);
$pattern = sprintf('/(%1$s[^%1$s]*%1$s)/i', $this->enclosure);
preg_match_all($pattern, $data, $matches);
foreach ($matches[0] as $match) {