Need to split a string based on spaces and (). Say for example:
Input String:
if condition or (condition-1 or condition-2) then print"
The output should be split into:
'if', 'condition', 'or', '(condition-1 or condition-2)', 'then', 'print'.
When I did the str.split()
even the value in the () are getting split based on spaces.