From 10a19f16ba250aac7c56681f7d3885150964366a Mon Sep 17 00:00:00 2001 From: vmadmax Date: Mon, 2 Feb 2026 09:41:54 +0100 Subject: [PATCH] refactor: simplify regex to use Unicode properties \p{L} and \p{N --- src/Factories/TestCaseFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 334cf3df..a64cc546 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -110,8 +110,8 @@ final class TestCaseFactory $relativePath = (string) preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $relativePath); // Remove escaped quote sequences (maintain namespace) $relativePath = str_replace(array_map(fn (string $quote): string => sprintf('\\%s', $quote), ['\'', '"']), '', $relativePath); - // Limit to A-Z, a-z, 0-9, and Unicode letters. - $relativePath = (string) preg_replace('/[^A-Za-z0-9\\\\\\p{L}]/u', '', $relativePath); + // Limit to Unicode letters and numbers. + $relativePath = (string) preg_replace('/[^\p{L}\p{N}\\\\]/u', '', $relativePath); $classFQN = 'P\\'.$relativePath;