import java.util.*; import java.lang.*; import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { { Pattern pattern = Pattern.compile("^\\w{2,}\\s"); Matcher matcher = pattern.matcher("Boston test"); } }