views:

55

answers:

2

I am using Castle Validators on my model. I have an EmailAddress property defined like so:

[ValidateEmail]
public string EmailAddress { get; set; }

The problem is that the regex (?) that the ValidateEmail attribute uses is incorrect. For instance, if I put in an email address like [email protected], it validates correctly, but if I put in an address like [email protected], it says it is not valid.

I realize that I can just use the ValidateRegExp attribute with my own regex, but if possible, I'd prefer to use what's already built in to the system.

So is there some way to "fix" the ValidateEmail attribute?

A: 

Given that the Castle project is open-source, grab the source and fix it yourself. Then submit the patch back to the project.

The project maintainers will appreciate it (normally; YMMV) and the project gets stronger.

Chris Miller
+3  A: 

Please get the latest build from the build server, this was fixed a couple of weeks ago.

Mauricio Scheffer

related questions