I need to split a string with regex in Java.
I need to get an array : A, B, 01/01/2016 12:31, D
why my regex doesn't work ? it will output the original string.
String source = "A|B|[01/01/2016 12:31]|D";
String regex = "\\|\\|\\[.*\\]\\|";
String[] array = source.split(regex);
for(String data: array){
System.out.println(data);
}