How can I validate regex for full name? I only want alphabets (no numericals) and only spaces for the regex. This is what I have done so far. Would you please help me fix th
Use \s for spaces. You can also use String.matches(regex) to test if the string matches a regular expression.
\s
public static boolean isFullname(String str) { String expression = "^[a-zA-Z\\s]*$"; return str.matches(expression); }