Java examples for java.util.regex:Match Number
is Digital by Regex
//package com.java2s; import java.util.regex.Pattern; public class Main { private static Pattern PATTERN_DIGITAL = Pattern.compile("^\\d+$"); public static boolean isDigital(String digital) { if (digital == null) return false; else/*from www . j a v a2s. c om*/ return PATTERN_DIGITAL.matcher(digital).matches(); } }