fork(1) download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String str = "asdasd.0001003333das202222220da345345hkjhkjh34543543kjh";
  9.  
  10. Pattern p = Pattern.compile("[1-9]{1}+[0-9]{0,9}");
  11. Matcher m = p.matcher(str);
  12. if (m.find()) {
  13. String match = m.group();
  14. System.out.println(match);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
1003333