Laravel パスワード半角英数+数字の組み合わせ正規表現

    public function rules()
    {
        return [
            'code'     => ['required', 'string', 'max:255', Rule::unique('users'), 'regex:/^[0-9a-zA-Z_\.\-]+$/'],
            'name'     => 'required|string|max:255',
            'password' => 'required|string|min:8|max:11|regex:/^(?=.*?[a-z])(?=.*?\d)[a-z\d]+$/i',
        ];
    }