fork download
  1. import re
  2. st = "hello[_ng11][test]hello3[_ngRTf]"
  3. modified_string = re.sub(r"\[_ng[^][]*]", "[]", st)
  4. print(modified_string)
Success #stdin #stdout 0.03s 9476KB
stdin
Standard input is empty
stdout
hello[][test]hello3[]