我正在尝试在Laravel中进行验证,不允许用户创建带有字母ÆØÅ的子域名(我住在丹麦) 已经尝试了很多不同的东西,但我似乎只能让它工作,如果æ,ø或å是第一个字母,而不是它之后。代码看起来像这样
public function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255|unique:organizations,name,'.$this->id,
'subdomain' => 'required|max:255|regex:/[a-z\-]+/i|unique:organizations,subdomain,'.$this->id,
'address' => 'required|regex:/^[a-z0-9- .]+/i|min:2',
'zip_code' => 'required|numeric',
'city' => 'required|regex:/^[a-z0-9- .]+/i|min:2',
'country' => 'required|max:2',
'cvr' => 'required|numeric|min:8',
'phone' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/'
]);
}