You can include whitespaces surrounding your delimiters by adding \\s*
. Try this way
String arguments[] = input.split("\\s*[:,]\\s*");
DEMO:
String input = "hey,what up man:1033:yes,okay that makes sense ,not: okay:1111, aaaaa,bbbbb";
String arguments[] = input.split("\\s*[:,]\\s*");
for (int i=0; i<arguments.length; i++){
System.out.println(i+")"+arguments[i]);
}
output:
0)hey
1)what up man
2)1033
3)yes
4)okay that makes sense
5)not
6)okay
7)1111
8)aaaaa
9)bbbbb