Java examples for java.util.regex:Match Number
is Integer String by Regex
//package com.java2s; import java.util.regex.Pattern; public class Main { /**//from w w w . j av a 2 s .c o m * * @param txt "1,2,3,4" * @return */ public static boolean isIntegerString(String txt) { return Pattern.matches("\\d*|(\\d*,\\d*)*", txt); } }