首先应该放上文本,其次应该放多个例子。代码及图片如下:
import re
text = 'Z4 阿西吧阿巴西\n西吧阿。\nCR biubiubiu'#你的文本
model = 'Z4(.*?)CR'#要匹配的模式
pattern = re.compile(model, re.S)#匹配换行符
data = re.findall(pattern, text)#匹配结果
chineseRegex=re.compile(r'选择黑.*转化。',re.DOTALL)
text1=chineseRegex.findall(text)
print('Here is the text copied:')
print(' '.join(text1))
pyperclip.copy(' '.join(text1))