Last active
November 9, 2022 12:07
-
-
Save htlin222/6ec7da1694776ebb2a816a0937de6049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import pyperclip as pc | |
# pip install pyperclip if not installed | |
text = pc.paste() | |
# replace: | |
# 「blablabla... 」 | |
# | |
# 摘錄自:Author. 「」。Apple Books. | |
# | |
# To: | |
# blablabla... | |
result = re.sub('(\u300c)(.*)(\u300d\n\n\u6458\u9304\u81ea.*Apple\sBooks\.)','\g<2>',text) | |
print(result) |
Author
htlin222
commented
Nov 9, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment