Skip to content

Instantly share code, notes, and snippets.

@daog1
Created October 1, 2022 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daog1/9b3000fe5cceb04db511078ee9489ee5 to your computer and use it in GitHub Desktop.
Save daog1/9b3000fe5cceb04db511078ee9489ee5 to your computer and use it in GitHub Desktop.
move debug string
import sys
import re
while True:
line = sys.stdin.readline()
if len(line) == 0:
break
ms= re.match(r'.*\[(.*[\d])\]', line)
if ms == None:
print(line)
else:
charstr = "".join([chr(int(b)) for b in ms.group(1).split(",")])
newline = line.replace(ms.group(1),charstr)
print(newline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment