Java Regex Number Validate isNumber(String number)

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

Description

is Number

License

Open Source License

Declaration

public static boolean isNumber(String number) 

Method Source Code

//package com.java2s;

import java.util.regex.Pattern;

public class Main {
    private static final Pattern NUMBER_REG = Pattern.compile("^\\d+$");

    public static boolean isNumber(String number) {
        return NUMBER_REG.matcher(number).matches();
    }//from w w w.  j  ava2 s. com
}

Related

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