Print Page | Close Window

NamedRegExPattern

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4100
Printed Date: 29-Mar-2025 at 9:06am


Topic: NamedRegExPattern
Posted By: gregweb
Subject: NamedRegExPattern
Date Posted: 06-Apr-2013 at 5:01pm
I have a RegExVerifier that looks like this:

[RegexVerifier("Email", "^[\\w.%-]+@[\\w.-]+\\.[a-zA-Z]{2,4}$")]
public static string Email;

This works just fine. However, I was trying to do this as a named RegEx, but couldn't get it to work:

I thought the syntax would be something like:

[RegexVerifier("Email", NamedRegexPattern.Email)]
public static string Email;

Greg



Replies:
Posted By: kimj
Date Posted: 08-Apr-2013 at 6:56pm
It looks like the RegexVerifierAttribute doesn't support this. We've added a defect report to fix this.


Posted By: gregweb
Date Posted: 09-Apr-2013 at 7:21am
Thanks Kim.



Print Page | Close Window