static BigInteger[] extractNonNegativeIntsFromString(S s) { Pattern p = compileRegexp("\\d+"); Matcher m = p.matcher(s); new L list; while (m.find()) list.add(new BigInteger(m.group())); return list.toArray(new BigInteger[list.size()]); }