From 1bf288234eaf7c853b3648a0a55dffa68a54c342 Mon Sep 17 00:00:00 2001 From: Kyle Baran Date: Fri, 16 Aug 2024 08:24:00 -0700 Subject: [PATCH] Updated scene name regex (#10980) Underscores are not allowed at all, and hyphens can't be the end character. Updated invalidSceneName text to reflect this. Resolves IR-3952 --- packages/client-core/i18n/en/editor.json | 2 +- packages/common/src/regex/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client-core/i18n/en/editor.json b/packages/client-core/i18n/en/editor.json index cbd6e57567..d02eab69e9 100755 --- a/packages/client-core/i18n/en/editor.json +++ b/packages/client-core/i18n/en/editor.json @@ -72,7 +72,7 @@ "unknownStatus": "Unknown Status", "CORS": "Possibly a CORS error", "urlFetchError": "Failed to fetch \"{{url}}\"", - "invalidSceneName": "Scene name must be 4-64 characters long, using only alphanumeric characters, hyphens, and underscores." + "invalidSceneName": "Scene name must be 4-64 characters long, using only alphanumeric characters and hyphens, and begin and end with an alphanumeric." }, "viewport": { "title": "Viewport", diff --git a/packages/common/src/regex/index.ts b/packages/common/src/regex/index.ts index 610dd4ebc6..2b89670699 100644 --- a/packages/common/src/regex/index.ts +++ b/packages/common/src/regex/index.ts @@ -29,7 +29,7 @@ Ethereal Engine. All Rights Reserved. export const VALID_FILENAME_REGEX = /^(?!.*[\s_<>:"/\\|?*\u0000-\u001F].*)[^\s_<>:"/\\|?*\u0000-\u001F]{1,64}$/ // eslint-disable-next-line no-control-regex export const WINDOWS_RESERVED_NAME_REGEX = /^(con|prn|aux|nul|com\d|lpt\d)$/i -export const VALID_SCENE_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]{2,62}[a-zA-Z0-9_\-]$/ +export const VALID_SCENE_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]{2,62}[a-zA-Z0-9]$/ export const VALID_HEIRARCHY_SEARCH_REGEX = /[.*+?^${}()|[\]\\]/g /**