
import os
import random

import re




phase_x = "PHASE 1: [Drive_Towards] [-, 24 to 34, -4 to -3][Ego: -10 to 0, FSR]"
phase_y = "PHASE 1: [Walk_Towards] [-, 1 to 3, -3 to -5][Ego:-4 to -2, FSL]"
LowerValue = 10
HigherValue = 20



myRegex_1 = "\d+\sto\s\d+"
myRegex_2 = str(LowerValue)+" to "+ str(HigherValue)



new_line_phase_x = re.sub(myRegex_1, myRegex_2, phase_x)
new_line_phase_y = re.sub(myRegex_1, myRegex_2, phase_y)

print(new_line_phase_x)
print(new_line_phase_y)

