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

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

[comment]: # ({80dc8e27-596faacb})
### 説明

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

このメソッドは、既存のグローバル正規表現を更新するためのものです。

::: noteclassic
このメソッドは*スーパ管理者*ユーザータイプでのみ利用可能です。
このメソッドを呼び出す権限は、ユーザーロールの設定で取り消すことができます。詳細は[ユーザーロール](/manual/web_interface/frontend_sections/users/user_roles)を参照してください。
:::

[comment]: # ({/80dc8e27-596faacb})

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

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

各オブジェクトに対して `regexpid` プロパティを定義する必要があり、その他の
プロパティはすべて任意です。渡されたプロパティのみが更新され、その他は
すべて変更されません。

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

|パラメータ|[Type](/manual/api/reference_commentary#data-types)|説明|
|--|--|------|
|expressions|array|[式](/manual/api/reference/regexp/object#expressions) オプション。|

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

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

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

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

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

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

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

[リクエスト](/manual/api#performing-requests):

```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"
        }
      ]
    },
    "id": 1
}
```

レスポンス:

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

[comment]: # ({/4dcfac64-aef504e5})

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

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

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