Java tutorial
//package com.java2s; public class Main { /** * Validates the user full name. * @param fullname - User full name. * @return - True (if is valid) or False (otherwise). */ public static boolean validateFullName(String fullname) { if (fullname == null || !fullname.matches("^[A-Za-z]{3,}(\\s[A-Za-z]+[\\.]{0,1})+[ ]*")) return false; return true; } }