RegEx - Python:错误:类型错误:findall() 缺少 1 个必需的位置参数:“字符串”

问题描述

我需要编写一个 RegEx 来搜索发票编号(例如:513426 / 41811 / MIU)。 但我总是收到错误

 $property = Property::
        where('published','=','1');

        if(!empty($searchInput)){
            $property+=$property
            ->orWhere('name','like',$percentageSearch)
            ->orWhere('village',$percentageSearch)
            ->orWhere('address',$percentageSearch)
            ->orWhere('reference_point',$percentageSearch)
            ->orWhere('price',$percentageSearch);
        }

        if(!empty($typeInput)){

            $property+=$property
            ->orWhere('type',$typeInput);
        }

        if(!empty($categoryInput)){
            $property+=$property
            ->orWhere('category_id',$categoryInput);
        }
        $prop=$property->get();

你知道我做错了什么吗

enter image description here

我真的很感激任何形式的帮助。

非常感谢

米莱娜

解决方法

这是findall的一个用法,你必须提供你想搜索正则表达式的字符串。

m=re.findall(regex,target_string)