diff --git a/src/Medoo.php b/src/Medoo.php index dc8c5d1b..5c9eb6ae 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -1379,7 +1379,7 @@ protected function columnMap($columns, array &$stack, bool $root): array foreach ($columns as $key => $value) { if (is_int($key)) { - preg_match("/(" . $this::TABLE_PATTERN . ")?(?" . $this::COLUMN_PATTERN . ")(?:\s*\((?" . $this::ALIAS_PATTERN . ")\))?(?:\s*\[(?(?:String|Bool|Int|Number|Object|JSON))\])?/u", $value, $keyMatch); + preg_match("/(" . $this::TABLE_PATTERN . "\.)?(?" . $this::COLUMN_PATTERN . ")(?:\s*\((?" . $this::ALIAS_PATTERN . ")\))?(?:\s*\[(?(?:String|Bool|Int|Number|Object|JSON))\])?/u", $value, $keyMatch); $columnKey = !empty($keyMatch['alias']) ? $keyMatch['alias'] : @@ -1389,7 +1389,7 @@ protected function columnMap($columns, array &$stack, bool $root): array [$columnKey, $keyMatch['type']] : [$columnKey]; } elseif ($this->isRaw($value)) { - preg_match("/(" . $this::TABLE_PATTERN . ")?(?" . $this::COLUMN_PATTERN . ")(\s*\[(?(String|Bool|Int|Number))\])?/u", $key, $keyMatch); + preg_match("/(" . $this::TABLE_PATTERN . "\.)?(?" . $this::COLUMN_PATTERN . ")(\s*\[(?(String|Bool|Int|Number))\])?/u", $key, $keyMatch); $columnKey = $keyMatch['column']; $stack[$key] = isset($keyMatch['type']) ? @@ -1432,7 +1432,7 @@ protected function dataMap( if (count($columnsKey) === 1 && is_array($columns[$columnsKey[0]])) { $indexKey = array_keys($columns)[0]; - $dataKey = preg_replace("/^[\p{L}_][\p{L}\p{N}@$#\-_]*\./u", '', $indexKey); + $dataKey = preg_replace("/^" . $this::COLUMN_PATTERN . "\./u", '', $indexKey); $currentStack = []; foreach ($data as $item) {