Android examples for java.util.regex:Number Pattern
is Number by regular expression
import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.CharacterStyle; import android.text.style.ForegroundColorSpan; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isNumb(String str) { Pattern pattern = Pattern.compile("[0-9]*"); Matcher matcher = pattern.matcher(str); return matcher.matches(); }//from w ww . ja va 2 s.c o m }