The split method takes a regex as an argument, so to use multiple delimiters, you need to enter a regex separated by the OR regex operator or using a character class (only if the delimiters are single characters).
Using the OR operator:
String delimiters = "\\t|,|;|\\.|\\?|!|-|:|@|\\[|\\]|\\(|\\)|\\{|\\}|_|\\*|/";
Using a character class:
String delimiters = "[-\\t,;.?!:@\\[\\](){}_*/]";
As you can see, some characters must be escaped, as they are regular expression metacharacters.
aleb2000
source share