package seedu.address.model.person;


import seedu.address.commons.exceptions.IllegalValueException;

/**
 * Represents a Person's phone number in the address book.
 * Guarantees: immutable; is valid as declared in {@link #isValidEmail(String)}
 */
public class Email {

    public static final String MESSAGE_EMAIL_CONSTRAINTS =
            "Person emails should be 2 alphanumeric/period strings separated by '@'";
    public static final String EMAIL_VALIDATION_REGEX = "[\\w\\.]+@[\\w\\.]+";

    public final String value;

    /**
     * Validates given email.
     *
     * @throws IllegalValueException if given email address string is invalid.
     */
    public Email(String email) throws IllegalValueException {
        assert email != null;
        email = email.trim();
        if (!isValidEmail(email)) {
            throw new IllegalValueException(MESSAGE_EMAIL_CONSTRAINTS);
        }
        this.value = email;
    }

    /**
     * Returns if a given string is a valid person email.
     */
    public static boolean isValidEmail(String test) {
        return test.matches(EMAIL_VALIDATION_REGEX);
    }

    @Override
    public String toString() {
        return value;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Email // instanceof handles nulls
                && this.value.equals(((Email) other).value)); // state check
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

}

@@ -340,60 +340,68 @@
    %22
-Person emails should be 2 alpha
+Item's end date should be in the format dd-mm-yyyy in 
 num
+b
 er
-ic/period string
 s se
@@ -415,10 +415,12 @@
  by 
-'@
+a '-
 '%22;%0A
@@ -480,29 +480,75 @@
  = %22
-%5B%5C%5Cw%5C%5C.%5D+@%5B%5C%5Cw%5C%5C.%5D+
+(0?%5B1-9%5D%7C%5B12%5D%5B0-9%5D%7C3%5B01%5D)-(0?%5B1-9%5D%7C1%5B012%5D)-((18%7C19%7C20%7C21)%5C%5Cd%5C%5Cd)
 %22;
+ 
 %0A%0A  

update REGEX to Date Format