python正则表达式中含有变量的写法

使用格式化字符串的方式实现
举例:
re.findall("(this,%s,'(.*?)'"%str(i),"abcd(this,1,'123123)')
这里i为变量
 

转载于:https://www.cnblogs.com/VseYoung/p/9095032.html

你可能感兴趣的:(python正则表达式中含有变量的写法)