From 5141562618dd6b906ee1661af74234f0156cd198 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Fri, 10 Oct 2025 14:34:23 +0200 Subject: [PATCH] cahnge the attribute to identifier and standard text --- Validation/IdentifierTextAttribute.cs | 13 +++++++++++++ Validation/StandardTextAttribute.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Validation/IdentifierTextAttribute.cs diff --git a/Validation/IdentifierTextAttribute.cs b/Validation/IdentifierTextAttribute.cs new file mode 100644 index 0000000..9459d5e --- /dev/null +++ b/Validation/IdentifierTextAttribute.cs @@ -0,0 +1,13 @@ + +using System.ComponentModel.DataAnnotations; +using System.Numerics; +using System.Text; +using System.Text.RegularExpressions; + +namespace NejCommon.Validation; + +public class IdentifierTextAttribute : RegexAttribute{ + public IdentifierTextAttribute() : base("^[a-zA-Z0-9_-]*$","Aa_bb-123"){ + + } +} \ No newline at end of file diff --git a/Validation/StandardTextAttribute.cs b/Validation/StandardTextAttribute.cs index 152de3e..239919a 100644 --- a/Validation/StandardTextAttribute.cs +++ b/Validation/StandardTextAttribute.cs @@ -7,7 +7,7 @@ using System.Text.RegularExpressions; namespace NejCommon.Validation; public class StandardTextAttribute : RegexAttribute{ - public StandardTextAttribute() : base("^[a-zA-Z0-9_-]*$","Aa_bb-123"){ + public StandardTextAttribute() : base("^[a-zA-Z0-9_-., ]*$","Aa_bb-123"){ } } \ No newline at end of file