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[]) {
        boolean retval = false;

        String name = "first last";
        String nameToken = "\\p{Upper}(\\p{Lower}+\\s?)";

        String namePattern = "(" + nameToken + "){2,3}";

        retval = name.matches(namePattern);

    }
}