fork download
  1. import random
  2. import re
  3.  
  4. code = """
  5. print('abc')
  6. print("def")
  7. """
  8.  
  9. def ultimate_garbage(length):return ''.join(chr(random.randint(ord('A'), ord('Z'))) for _ in range(length))
  10.  
  11. # Generate placeholders
  12. def zwfhq():
  13. length = 1
  14. while True:
  15. zwf = ultimate_garbage(length)
  16. if zwf not in code:
  17. break
  18. length += 1
  19. print(length)
  20. return zwf
  21.  
  22.  
  23. # Extract the content in double quotes
  24. syh = re.findall(r'"((?:[^"\\]|\\.)*)"', code)
  25. code = code.replace(syh[0], zwfhq())
  26.  
  27. # Extract content in single quotes
  28. dyh = re.findall(r"'((?:[^'\\]|\\.)*)'", code)
  29. code = code.replace(dyh[0], zwfhq())
  30.  
  31. print(code) # print(''c")
Success #stdin #stdout 0.21s 15980KB
stdin
Standard input is empty
stdout
print('L')
print("A")