package org.apache.isis.viewer.wicket.ui.pages.accmngt.password_reset;

import org.apache.wicket.validation.validator.PatternValidator;

/**
 * Copy of {@link org.apache.wicket.validation.validator.EmailAddressValidator}.
 */
public class EmailAddressValidator extends PatternValidator {
    private static final long serialVersionUID = 1L;
    private static final EmailAddressValidator INSTANCE = new EmailAddressValidator();

    public static EmailAddressValidator getInstance() {
        return INSTANCE;
    }

    protected EmailAddressValidator() {
        super(
        "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*((\\.[A-Za-z]{2,}){1}$)", 2);
    }
}

@@ -65,16 +65,49 @@
 reset;%0A%0A
+import java.util.regex.Pattern;%0A%0A
 import o
@@ -626,88 +626,239 @@
 9-%5D+
-(%5C%5C.%5B_A-Za-z0-9-%5D+)*@%5BA-Za-z0-9-%5D+(%5C%5C.%5BA-Za-z0-9-%5D+)*((%5C%5C.%5BA-Za-z%5D%7B2,%7D)%7B1%7D$)%22, 2
+%22 +%0A                %22(%5C%5C.%5B_A-Za-z0-9-%5D+)*%22 +%0A                %22@%5BA-Za-z0-9-%5D+%22 +%0A                %22(%5C%5C.%5BA-Za-z0-9-%5D+)*%22 +%0A                %22(%22 +%0A                  %22(%5C%5C.%5BA-Za-z%5D%7B2,%7D)%7B1%7D%22 +%0A                %22$)%22, Pattern.CASE_INSENSITIVE
 );%0A 

splits regex across multiple lines