I\'ve been looking through pages and pages of Google results but haven\'t come across anything that could help me.
What I\'m trying to do is split a string like
This should do what you want:
import java.util.regex.*; String d = "Bananas22Apples496Pears3" Pattern p = Pattern.compile("[A-Za-z]+|[0-9]+"); Matcher m = p.matcher(d); while (m.find()) { System.out.println(m.group()); } // Bananas // 22 // Apples // 496 // Pears // 3