Skip to content

Commit 6a0e7d3

Browse files
Copilotmitchdenny
andcommitted
Add documentation comment explaining the Unicode-aware project name validation regex
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
1 parent ca1a26f commit 6a0e7d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Aspire.Cli/Commands/NewCommand.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTem
222222

223223
internal static partial class ProjectNameValidator
224224
{
225+
// Regex for Unicode-aware project name validation:
226+
// - Starts with Unicode letter or number [\p{L}\p{N}]
227+
// - Can contain Unicode letters, numbers, connector punctuation (underscore), dash, dot, and combining marks
228+
// - Must end with Unicode letter or number, optionally followed by combining marks
229+
// - Length: 1-254 characters
230+
// - Excludes unsafe characters: / \ : * ? " < > |
225231
[GeneratedRegex(@"^[\p{L}\p{N}]([\p{L}\p{N}\p{Pc}.\-\p{Mn}\p{Mc}]{0,252}[\p{L}\p{N}][\p{Mn}\p{Mc}]*|[\p{L}\p{N}\p{Pc}.\-\p{Mn}\p{Mc}]{0,252}[\p{L}\p{N}])?$", RegexOptions.Compiled)]
226232
internal static partial Regex GetAssemblyNameRegex();
227233

0 commit comments

Comments
 (0)