fork download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. public class Main
  5. {
  6. public static void main(String[] args) throws Exception
  7. {
  8. Pattern p = Pattern.compile("(?:^|/)(\\d+)(?=/|$)");
  9. Matcher m = p.matcher("8/5/4/3");
  10. while (m.find()) {
  11. System.out.println(m.group(1));
  12. }
  13. }
  14. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
8
5
4
3