Java Regex Number Validate isNumber(String s)

Here you can find the source of isNumber(String s)

Description

is Number

License

Open Source License

Declaration

private static Boolean isNumber(String s) 

Method Source Code

//package com.java2s;
/**//from   w w  w  . j  a  v a2  s  . c  o  m
 * Copyright (c)2010-2011 Enterprise Website Content Management System(EWCMS), All rights reserved.
 * EWCMS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * http://www.ewcms.com
 */

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static Boolean isNumber(String s) {
        Pattern pa = Pattern.compile("[0-9]*");
        Matcher ma = pa.matcher(s);
        if (ma.matches()) {
            return true;
        }
        return false;
    }
}

Related

  1. isNum(String str)
  2. isNum(String str)
  3. isNumber(String data)
  4. isNumber(String number)
  5. isNumber(String s)
  6. isNumber(String s, boolean[] realnum)
  7. isNumber(String str)
  8. isNumber(String str)
  9. isNumber(String str)