wrong output
#2878
Replies: 1 comment
|
After numerous tests, it has been found that using copyq print 1% yields the correct string, but the following methods result in errors when using re.sub for replacement:
===================== 1.Directly use JavaScript for replacement in copyq: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
copy text :
'"“’a1 a2
b1 b2
c1 c2
a1 , a2
b1 , b2
c1 ,, c2 '"“’
command python: (The script works fine in Python, but when running in the CopyQ command, the output is garbled. )
python -c '
import sys
import re
input_text=sys.stdin.read()
#print("in:",input_text)
processed_text = re.sub(r'(?m)^ +| +$', '', input_text)
processed_text = re.sub(r'[,, ]+', '\t', processed_text)
#print("out:",output_text, end="")
print(processed_text, end="")'
output:
'"����a1 a2
b1 b2
c1 c2
a1 , a2
b1 �� b2
c1 ��, c2 '"����
All reactions