Home Dashboard Directory Help
Search

RegularExpressionAttribute bug by Ludovic Dubois


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 773530
Opened: 12/5/2012 4:42:39 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Regular expression such as "^\S+$" does not work because "" succeed!

RegularExpressionAttribute.IsValid has a test string.IsNullOrEmpty(input)) return true; that is wrong. null is a special case, but empty should be used as a testable value.
Details
Sign in to post a comment.
Posted by Microsoft on 2/18/2013 at 10:33 AM
The Silverlight docs state this behavior (http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.regularexpressionattribute(v=VS.95).aspx) but the .NET full docs do not (http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.regularexpressionattribute(v=vs.110).aspx). We plan to update the documentation to match.
Posted by Microsoft on 12/6/2012 at 12:18 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by Microsoft on 12/5/2012 at 4:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Ludovic Dubois on 12/5/2012 at 2:41 PM
I added [Required], but it seems it does not make sense since I specify twice I need data!