is Validate Alpha Chars by Regex - Java java.util.regex

Java examples for java.util.regex:Match Word

Description

is Validate Alpha Chars by Regex

Demo Code


//package com.java2s;
import java.util.regex.Pattern;

public class Main {
    private static final Pattern alphaCharPattern = Pattern
            .compile("\\p{Alpha}*");

    public static boolean isValidateAlphaChars(String input) {
        return alphaCharPattern.matcher(input).matches();
    }// w  w  w. ja va 2 s. co m
}

Related Tutorials