import java.util.regex.*; public class Regexp { public static void main(String []args) { String input = "Ι ate 10\tpieces\tof\tdark\tchocolate."; // βρες όλα τα ψηφία που ακολουθούνται από κενούς χαρακτήρες Pattern p = Pattern.compile("\\d\\s"); Matcher m = p.matcher(input); while(m.find()) { System.out.println("Found: "+input.substring(m.start(), m.end()) ); } } }