package com.leo.test;
  

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

public class Test12 {
public static void main( String [] args ) {
String str = "iu7i8hy4jnb2";
Pattern p = Pattern.compile( "\\d" );
Matcher matcher = p.matcher( str );
while ( matcher.find() ) {
System.out.print(matcher.group());
}
}
}

四医院翻墙砖家 answered 12 years, 8 months ago

Your Answer