Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RegEx-Python:Error:TypeError:findall()缺少1个必需的位置参数:';字符串';_Python_Regex_String_Typeerror_Findall - Fatal编程技术网

RegEx-Python:Error:TypeError:findall()缺少1个必需的位置参数:';字符串';

RegEx-Python:Error:TypeError:findall()缺少1个必需的位置参数:';字符串';,python,regex,string,typeerror,findall,Python,Regex,String,Typeerror,Findall,我需要编写一个正则表达式来搜索发票号(例如:513426/41811/MIU)。 但我总是犯错误: "Python: Error:TypeError: findall() missing 1 required positional argument: 'string' " 你知道我做错了什么吗 我真的非常感谢任何帮助 非常感谢 Milena这是findall的用法,您必须提供要搜索正则表达式的字符串 m=re.findall(regex,target_string)

我需要编写一个正则表达式来搜索发票号(例如:513426/41811/MIU)。 但我总是犯错误:

 "Python: Error:TypeError: findall() missing 1 required positional argument: 'string' "
你知道我做错了什么吗

我真的非常感谢任何帮助

非常感谢


Milena

这是findall的用法,您必须提供要搜索正则表达式的字符串

m=re.findall(regex,target_string)

您需要包含正在使用正则表达式搜索的字符串
re.findall(模式、字符串)
您没有提供regex输入数据。您为它提供了模式,但没有包含发票号的字符串。