We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0832384 commit 55eb38aCopy full SHA for 55eb38a
src/EDI/Parser.php
@@ -522,10 +522,10 @@ private function unwrap(string &$string): array
522
$this->errors[] = 'This file contains some segments without terminators';
523
}
524
525
- $terminatorRegex = '/(([^'.$this->symbRel.']'.$this->symbRel.'{2})+|[^'.$this->symbRel.'])'.$this->symbEnd.'|[\r\n]+/';
+ $terminatorRegex = '/((?<!'.$this->symbRel.')(?:'.$this->symbRel.$this->symbRel.')*)'.$this->symbEnd.'|[\r\n]+/';
526
527
if ($this->strict) {
528
- $terminatorRegex = '/(([^'.$this->symbRel.']'.$this->symbRel.'{2})+|[^'.$this->symbRel.'])'.$this->symbEnd.'/';
+ $terminatorRegex = '/((?<!'.$this->symbRel.')(?:'.$this->symbRel.$this->symbRel.')*)'.$this->symbEnd.'/';
529
530
531
$string = (string) \preg_replace(
0 commit comments