正規取得文字のジャンプ中の数値

647 ワード

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

public class A {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String s = "\\d*+";
		Pattern p = Pattern.compile(s);
		Matcher m = p
				.matcher("       2011071    281530020122   02,     3 ,    10000000 .");
		while (m.find()) {
			String text = m.group();
			if (null != text && !"".equals(text.trim())) {
				System.out.println(text);
			}
		}
	}
	
	

}

文字の中から数字を取得