Java tutorial
//package com.java2s; import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isPuleNumber(String str) { if (TextUtils.isEmpty(str)) { return false; } String reg = "^\\d*"; Pattern pattern = Pattern.compile(reg); Matcher matcher = pattern.matcher(str); boolean flag = matcher.matches(); return flag; } }