Add support for ignoring blank strings when using regularExpressionRule

Topics: Developer Forum, Project Management Forum, User Forum
Oct 15, 2007 at 3:22 AM
Is it feasible change the RegEx Rule validation to treat empty string and nulls in the same category and skip validation when either is encountered? When working in, a lot of times we'll be saving blank string textbox values into a property (no longer null string). Looking at the sample quick start app, I'd want to collect a person's phone number only if it's in a valid format. Otherwise, the field is not required and I don't want to fail if an empty string was recorded.

I was thinking we could modify the regEx to handle the empty case, but it seems more intuitive to treat null and empty string as one (or maybe another flag to provide this functionality). Additionally, it would be more consistent with the standard .net validation process and help with migration?

Or is there another approach to this problem I'm overloooking?
Oct 22, 2007 at 8:07 AM
I think you are correct in that RegexRule should ignore empty strings.
I have checked in the code changes. Let me know what you think.