I have various strings that might have multiple leading spaces.
string_1 = ' param A val A'
string_2 = 'param B val B'
....
I want to replace all multiple spaces with a single space IF the multiple spaces are not in the start of the string.
I want output of above to become
string_1 = ' param A val A'z
string_2 = 'param B val B'
My current solution replaces all multiple spaces with a single space regardless.
re.sub('\s+',' ',s)
How would I construct a pattern that only captures non leading multiple spaces?