public static final int SHORTEST_POSSIBLE_PHONE_NUM=6; // why not 3? trade off since too many occurances of 3 and 4 nums that arent real numbers. private Vector extractPhoneNumbersFromString(String body) { char[] bodyC = body.toCharArray(); int startIndex = -1; int endIndex = -1; char lastChar='x'; Vector v = new Vector(); for (int i=0; i0 && endIndex>0) && (endIndex-startIndex>=SHORTEST_POSSIBLE_PHONE_NUM) ) { v.addElement( body.substring(startIndex,endIndex) ); //add the number to the vector } startIndex=-1; endIndex=-1; } } return v; }