fork download
  1. import re
  2.  
  3. regex = r"\(color:\w+\([^()]*\); \)|\?[^?]+(?=\)$)"
  4. test_str = " this is in blue color\",\"(Refer: 'Set the TEST VIN value' in document: [UserGuide_Upgrade_2020_W10_final.pdf|CB:/displayDocument/UserGuide_Upgrade_2020_W10_final.pdf)"
  5. result = re.sub(regex, "", test_str)
  6.  
  7. print (result)
Success #stdin #stdout 0.02s 9408KB
stdin
Standard input is empty
stdout
 this is in blue color","(Refer: 'Set the TEST VIN value' in document: [UserGuide_Upgrade_2020_W10_final.pdf|CB:/displayDocument/UserGuide_Upgrade_2020_W10_final.pdf)