假设我创建了一个编译的re:
x = re.compile('^\d+$')
是否有方法从x中提取模式字符串(^\d+$)?
你可以用
x.pattern
来自Python documentation on Regular Expression Objects