String#split(arg)
takes regex as argument, and in regex if you want to match one of many characters then you can use this form (a|b|c|...|z)
which means character that is eater a OR b OR c OR [...] OR z
(instead of ...
you actually need to put rest of alphabet letters).
But since that form is ugly you can use character class that can look like [abcd...z]
. But this can also be optimized a little using range of characters [a-z]
.
Now lets go back to your question. If you want to match all spaces and additional characters then you can try to split on every [\\s.,;?]
. Also in case you want to split on single group of that characters you can use [\\s.,;?]+
. +
means one or more elements that are described before +
.
So maybe try this way
String[] abc = para.split("[\\s.,;?]+");