Splitting a string dynamically

@mlgtechuser

I’ll try to explain again.

If I have only an equation like this

(10 < DD99) && (DD99 < 15) or even ( > 15 DD67 && DD67 18 <)

The string is reformatted to this by moving the string by index and removing the duplicated substring.

DD99 10:15
DD67 15:18

This gives me a range output, so I’ll refer to this a range from now on. This is fine if the string only has range values/ equations.
If I have only this in the string.

DD88 > 10 && DD11 >= 12

This can also be dealt with in my code easily and I’ll call this type nonrange as I can’t think of a better name. The non range doesnt require any special formatting and is fine as is.

DD88 > 10 
DD11 >= 12

When I have a string combined with both types then my code explodes.

(10 < DD99 && DD99 < 15) && (DD88 > 20) &&
 ( > 15 DD67 && DD67 18 <) || (DD11 <= 15)

So I am hoping for some way to discriminate between these two types and and split the string accordingly.

As with a previous reply I had it partially working but my regex wasn’t robust enough and picked out nonrange with range values and vice versa.
Note that matching by brackets also didn’t work as some equations use brackets and others don’t.

Btw how do you format code in the post on your phone , there is no option.