String pattern = "\\W+"; // non-word chars will be the delimiters.
String input = "QA777. is the next flight. It is on time.";
RE r = new RE(pattern); // Construct an RE object
String[] words = r.split(input);
for (int i = 0; i < words.length; i++) {
System.out.println(i + " " + words[i]);
}