Java examples for Regular Expressions:Pattern
A string is split into words marked by colons, semicolons, vertical bars, or tab characters.
public class Main { public static void main(String[] args) { String s = "One:Two;Three|Four\tFive"; String regex = "[:;|\\t]"; String strings[] = s.split(regex); for (String word : strings) System.out.println(word);//from w w w . ja va 2s . c om } }