public class SplitExample {
public static void main(String[] args) {
String input = "abc,defg;hijk|lmnop-qrst_uvwxyz";
// Match multiple separators: comma, semicolon, pipe, dash, underscore
String[] result = input.split("[,;|\\-_]");
for (String word : result) {
System.out.println(word);
}
}
}
/*
run:
abc
defg
hijk
lmnop
qrst
uvwxyz
*/