我正在尝试将正则表达式定义为 IGNORECASE 并且点将匹配所有。
以下代码:
str = "Test "
a = re.findall(r"(\w+)", str, re.IGNORECASE, re.S)
得到错误
TypeError: findall() takes at most 3 positional arguments (4 given)
请您参考如下方法:
Multiple flags can be specified by bitwise OR-ing them;
re.I | re.Msets both theIandMflags, for example.
str = "Test "
a = re.findall(r"(\d+)", str, re.IGNORECASE|re.S)
