[comment]: # translation:outdated

[comment]: # ({ffe55246-ffe55246})
# regexp.update

[comment]: # ({/ffe55246-ffe55246})

[comment]: # ({327f112e-596faacb})
### 説明

`object regexp.update(object/array regularExpressions)`

このメソッドで、既存のグローバル正規表現を更新できます。

::: noteclassic
このメソッドは*Super admin*ユーザータイプでのみ使用できます。 メソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。 詳細については[ユーザーの役割](/manual/web_interface/frontend_sections/administration/user_roles)を参照してください。
:::

[comment]: # ({/327f112e-596faacb})

[comment]: # ({b570fe52-f26d83f8})
### パラメータ

`(object/array)` 更新される正規表現のプロパティ

`regexpid`プロパティはオブジェクトごとに定義する必要があり、すべてのプロパティはオプションです。 渡されたプロパティのみが更新され、他のプロパティは変更されません。

このメソッドは[標準プロパティ](object#expressions_object)に加えて、次のパラメーターを受け入れます。

|パラメータ|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|expressions|array|[Expressions](/manual/api/reference/regexp/object#expressions_object)オプション|

[comment]: # ({/b570fe52-f26d83f8})

[comment]: # ({7a7252f7-7a7252f7})
### 戻り値

`(object)` `regexpids`プロパティの下にある更新された正規表現のIDを含むオブジェクトを返します。

[comment]: # ({/7a7252f7-7a7252f7})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({6edfc4aa-aef504e5})
#### ファイルシステムディスカバリのグローバル正規表現更新

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "regexp.update",
    "params": {
      "regexpid": "1",
      "name": "File systems for discovery",
      "test_string": "",
      "expressions": [
        {
          "expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|zfs)$",
          "expression_type": "3",
          "exp_delimiter": ",",
          "case_sensitive": "0"
        },
        {
          "expression": "^(ntfs|fat32|fat16)$",
          "expression_type": "3",
          "exp_delimiter": ",",
          "case_sensitive": "0"
        }
      ]
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "regexpids": [
            "1"
        ]
    },
    "id": 1
}
```

[comment]: # ({/6edfc4aa-aef504e5})

[comment]: # ({90c4873e-90c4873e})
### ソース

CRegexp::update() in *ui/include/classes/api/services/CRegexp.php*.

[comment]: # ({/90c4873e-90c4873e})
