fork download
  1. import re
  2. Text = 'LD(_030S.F.IN)OR(_080T_SAF_OUT)COIL(xxSF[4].Flt[120].0)'
  3. m = re.search(r'(?:OR|LD)\([^()]*\)COIL\(xxSF\[\d]\.Flt\[\d+]\.\d+', Text)
  4. if m:
  5. print(m.group())
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
OR(_080T_SAF_OUT)COIL(xxSF[4].Flt[120].0