/*
* Uses split to break up a string of input separated by
* commas and/or whitespace.
*/
import java.util.regex.*;
public class RegexSplit {
public static void main(String[] args) throws Exception
{
// Create a pattern to match breaks
String buf = "one,two,three";
Pattern p = Pattern.compile("[,]");
System.out.println("Before split = " buf);
// Split input with the pattern
String[] result = p.split(buf);
for (int i=0; i