我试着在一行中做一些不同的正则表达式语句。。。语法应该是更多的re.sub(r''.format(x1,y1), ''.format(x2,y2), a, 1)
,其中x1应该代替x2,y1应该代替单个字符串中的y2
import re
a = 'browhereareyou'
def sub(p, m):
return re.sub(p, m, a, 1)
# no idea what next though i'm sure my func is not okay as well
Tags:
目前没有回答
相关问题 更多 >
编程相关推荐