Android examples for java.util.regex:Number Pattern
is Big Decimal by regular expression
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import java.text.SimpleDateFormat; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isBigDecimal(String str) { Pattern p = Pattern.compile("^(-)?(([1-9]{1}\\d*)|([0]{1}))?$"); Matcher m = p.matcher(str); return m.matches(); }//from w ww .j a v a 2 s . c o m }