I am trying to split a string to array string with all the letter as name at beginning (sometimes the name has many words) in array string.
Simple:
car water apple 04:48 05:18 05:46 06:16 06:46 07:16 07:46
bridge night 04:57 05:27 05:56 06:26 06:56 07:26 07:56
result should looks like this:
[car water apple, 04:48 05:18 05:46 06:16 06:46 07:16 07:46 ]
[bridge night, 04:57 05:27 05:56 06:26 06:56 07:26 07:56]
Code:
if (line.contains(":") && min_value > 0) {
// With this regular expression I am getting it without `car water apple`
String[] newLine = line.replaceFirst(
"(?m)^.*?(?=\\d+:\\d+)", "").split("\\s+");
}
How can fix it?
I appreciate any help.