Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {
        System.out.println("isValid = " + isValidEmailAddress("user@domain.com"));
    }

    static boolean isValidEmailAddress(String email) {
        String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";

        return email.matches(EMAIL_REGEX);
    }
}