This is an example list of strings
new_text = ['XIC(Switch_A)OTE(Light1) XIC(Light1)OTE(Light2) Motor On Delay Timer XIC(Light1)TON(Motor_timer',
'?',
'?) XIC(Motor_timer.DN)OTE(Motor)']
I would like to extract XIC(Switch_A) into one list, OTE(Light1) into another list, TON(Motor_timer) into another list and so on.
This is the code in Python 3 that I have tried
for words in new_text:
match = re.search('XIC(.*)', words)
print(match.group(1))
How do I go about extracting OTE(Tag name), XIC(Tag name), XIO(Tag name) into their own lists or groups?