I am trying to split a given string using the java split method while the string should be devided by two different characters (+ and -) and I am willing to save the characters inside the array aswell in the same index the string has been saven.

for example :

input : `String s = "4x^2+3x-2"`

output : 
`arr[0] = 4x^2
arr[1] = +3x
arr[2] = -2`

I know how to get the + or - characters in a different index between the numbers but it is not helping me,
any suggestions please?