In the string:
my_string = 'log (x)'
I need to remove all spaces ' '
in front of left parentheses '('
This post suggests using:
re.sub(r'.*(', '(', my_string)
which is an overkill because it has the same effect as my_string[my_string.index('('):]
and removes also 'log'
Is there some regexpr magic to remove all spaces in front of another specific character?