You can use this split
split("(?=\\d*$)",2);
It will split on place before zero or more digits (\\d
) which have end of string $
after it (which means they are at the end of string).
Parameter 2
will limit size of result array to two elements preventing this regex from farther splitting in places I marked |
below
hello0|0|1
so result will be hello
001
.