fork(2) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4. class rTest {
  5. public static void main (String[] args) {
  6.  
  7. String s = "1234567 Mike Peloso ";
  8. Pattern p = Pattern.compile("[A-Za-z]+");
  9. Matcher m = p.matcher(s);
  10.  
  11. while (m.find()) {
  12. System.out.println(m.start());
  13. System.out.println(m.group());
  14. }
  15.  
  16. }
  17. }
Success #stdin #stdout 0.07s 381248KB
stdin
Standard input is empty
stdout
27
Mike
52
Peloso