umber of space characters String text="blah blah blah"; //by factory method RETokenizer tok1=p.tokenizer(text); //or by constructor RETokenizer tok2=new RETokenizer(p,text); Now the one way is to use the tokenizer as a token enumeration/iterator:
while(tok1.hasMore()) System.out.println(tok1.nextToken());
and another way is to split it into a String array:
String[] arr=tok2.split(); for(int i=0;i
@see Pattern#tokenizer(java.lang.String)