1 36 package org.columba.ristretto.imap.parser; 37 38 import java.util.LinkedList ; 39 import java.util.List ; 40 import java.util.regex.Matcher ; 41 import java.util.regex.Pattern ; 42 43 import org.columba.ristretto.imap.IMAPResponse; 44 45 51 public class NumberListParser { 52 53 private static final Pattern numberPattern = Pattern.compile("\\b(\\d+)\\b"); 54 55 61 public static Integer [] parse(IMAPResponse r) { 62 List result = new LinkedList (); 63 Matcher matcher = numberPattern.matcher(r.getResponseMessage()); 64 while( matcher.find() ) { 65 result.add(new Integer (matcher.group(1))); 66 } 67 return (Integer [])result.toArray(new Integer [] {}); 68 } 69 } 70 | Popular Tags |