Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Secullum.Validation/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public Validation<T> IsEmail(Expression<Func<T, string>> expression)
ThrowIfNotMemberAccessExpression(expression.Body);

var value = expression.Compile()(target);
var regex = new Regex(@"^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-\.]+$");
var regex = new Regex(@"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-\.]+$");

if (!string.IsNullOrEmpty(value) && !regex.IsMatch(value))
{
Expand Down
1 change: 1 addition & 0 deletions test/Secullum.Validation.Tests/IsEmailTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class IsEmailTests : BaseTest
[InlineData("")]
[InlineData("fernando@domain.com")]
[InlineData("fernando@domain.com.br")]
[InlineData("fernando+teste@domain.com")]
public void IsEmail_GivenValidField_DontReturnErrors(string email)
{
var person = new Person() { Email = email };
Expand Down