[comment]: # translation:outdated

[comment]: # ({acf00dc8-acf00dc8})
# regexp.create

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

[comment]: # ({a0b1d1c3-3c60fab5})
### 説明

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

このメソッドで、新しいグローバル正規表現を作成できます。

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

[comment]: # ({/a0b1d1c3-3c60fab5})

[comment]: # ({12a80fcd-f518ef9f})
### パラメータ

`(object/array)` 作成する正規表現

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

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

[comment]: # ({/12a80fcd-f518ef9f})

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

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

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

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

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

[comment]: # ({941caacc-3d653b4d})
#### 新しいグローバル正規表現の作成

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "regexp.create",
    "params": {
      "name": "Storage devices for SNMP discovery",
      "test_string": "/boot",
      "expressions": [
        {
          "expression": "^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$",
          "expression_type": "4",
          "case_sensitive": "1"
        }
      ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

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

[comment]: # ({/941caacc-3d653b4d})

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

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

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