Bifrost/src/Bifrost.Web/Features/ConceptVotes/ConceptKey.cs
Meta Vens b17436ce4f Concept subject registry and concepts plan|apply host command
ConceptSubjectRegistry is the only writer of ConceptSubject. ConceptKey is the
one key grammar (anchored with \z), shared with ConceptAppraisalService.
Not yet built or tested at this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:58:04 +02:00

13 lines
446 B
C#

using System.Text.RegularExpressions;
namespace Bifrost.Web.Features.ConceptVotes;
// The one grammar for a concept collection or key. \z, not $: $ admits a trailing line feed.
public static class ConceptKey
{
public const int MaxLength = 80;
private static readonly Regex Shape = new(@"^[a-z0-9-]{1,80}\z", RegexOptions.CultureInvariant);
public static bool IsValid(string? value) => value is not null && Shape.IsMatch(value);
}