From 073e4c4877f68be370ef321d7f54db4b7d684a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sun, 15 Feb 2026 14:38:04 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=9E=90=EB=A7=89=20=EC=A0=95=EA=B7=9C?= =?UTF-8?q?=EC=8B=9D=20lookbehind=20=E2=86=92=20\K=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(=EB=A9=80=ED=8B=B0?= =?UTF-8?q?=EB=B0=94=EC=9D=B4=ED=8A=B8=20=ED=98=B8=ED=99=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PCRE lookbehind는 멀티바이트 문자 클래스에서 가변길이 오류 발생 → \K (match reset)로 대체하여 구두점은 앞 문장에 유지 Co-Authored-By: Claude Opus 4.6 --- app/Services/Video/VideoAssemblyService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/Video/VideoAssemblyService.php b/app/Services/Video/VideoAssemblyService.php index f62b6c02..6f29d301 100644 --- a/app/Services/Video/VideoAssemblyService.php +++ b/app/Services/Video/VideoAssemblyService.php @@ -306,9 +306,9 @@ private function splitIntoSentences(string $text): array return [$text]; } - // 구두점 뒤 + 다음이 구두점이 아닐 때 + 공백 있을 때만 분리 - // "정말요?!" → 분리 안 됨, "정말요?! 다음 문장" → 분리됨 - $rawParts = preg_split('/(?<=[.!?。!?])(?![.!?。!?])\s+/u', $text, -1, PREG_SPLIT_NO_EMPTY); + // \K로 구두점은 앞 문장에 유지, 공백만 구분자로 소비 + // "정말요?!" → 분리 안 됨, "정말요?! 다음 문장" → ["정말요?!", "다음 문장"] + $rawParts = preg_split('/[.!?。!?](?![.!?。!?])\K\s+/u', $text, -1, PREG_SPLIT_NO_EMPTY); if (count($rawParts) <= 1) { return [$text];