问题描述
我需要编写一个 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();
我真的很感激任何形式的帮助。
非常感谢
米莱娜
解决方法
这是findall的一个用法,你必须提供你想搜索正则表达式的字符串。
m=re.findall(regex,target_string)