From ad3cd231ac093a744a499590f7edcbf5eaedb182 Mon Sep 17 00:00:00 2001 From: Dennis Huebner Date: Fri, 6 Dec 2024 12:48:20 +0100 Subject: [PATCH] Added regex comment --- packages/plugin-ext/src/common/plugin-identifiers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/plugin-ext/src/common/plugin-identifiers.ts b/packages/plugin-ext/src/common/plugin-identifiers.ts index 026ba12283cf3..8c1514c95751c 100644 --- a/packages/plugin-ext/src/common/plugin-identifiers.ts +++ b/packages/plugin-ext/src/common/plugin-identifiers.ts @@ -82,6 +82,16 @@ export namespace PluginIdentifiers { return { id: probablyId.slice(0, endOfName) as UnversionedId, version: probablyId.slice(endOfName + 1) }; } + /** + * Regular expression to match plugin identifiers. + * + * The pattern matches strings in the format: `vendor.name@version`. + * + * Expected matching strings examples: + * - `vendor.name@prerelease` + * - `vendor.name@1.0.0` + * - `vendor.name@1.0.0-beta` + */ const EXTENSION_IDENTIFIER_WITH_VERSION_REGEX = /^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/; /**