[comment]: # translation:outdated

[comment]: # ({b75e4c49-b75e4c49})
# regexp.get

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

[comment]: # ({71d4e94a-15aa8348})
### 説明

`integer/array regexp.get(object parameters)`

このメソッドで、指定されたパラメーターに従ってグローバル正規表現を取得できます。

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

[comment]: # ({/71d4e94a-15aa8348})

[comment]: # ({c2df5de2-9693dfa8})
### パラメータ

`(object)` 目的の出力を定義するパラメーター

このメソッドは、次のパラメーターをサポートします

|パラメータ|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|regexpids|string/array|指定されたIDを持つ正規表現のみを返します|
|selectExpressions|query|[expressions](/manual/api/reference/regexp/object#expressions_object)プロパティを返します|
|sortfield|string/array|指定されたプロパティで結果を並べ替えます<br><br>利用可能な値は、`regexpid`と`name`です。|
|countOutput|boolean|すべての`get`メソッドに共通するこれらのパラメーターについては[リファレンス解説](/manual/api/reference_commentary#common_get_method_parameters)ページで詳しく説明されています。|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/c2df5de2-9693dfa8})

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

`(integer/array)` 次のいずれかを返します:

-   オブジェクトの配列
-   `countOutput`パラメータが使用されている場合、取得されたオブジェクトの数

[comment]: # ({/7223bab1-7223bab1})

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

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

[comment]: # ({9087dc56-196e1642})
#### グローバル正規表現の取得

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "regexp.get",
    "params": {
        "output": ["regexpid", "name"],
        "selectExpressions": ["expression", "expression_type"],
        "regexpids": [1, 2],
        "preservekeys": true
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
  "jsonrpc": "2.0",
  "result": {
    "1": {
      "regexpid": "1",
      "name": "File systems for discovery",
      "expressions": [
        {
          "expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$",
          "expression_type": "3"
        }
      ]
    },
    "2": {
      "regexpid": "2",
      "name": "Network interfaces for discovery",
      "expressions": [
        {
          "expression": "^Software Loopback Interface",
          "expression_type": "4"
        },
        {
          "expression": "^(In)?[Ll]oop[Bb]ack[0-9._]*$",
          "expression_type": "4"
        },
        {
          "expression": "^NULL[0-9.]*$",
          "expression_type": "4"
        },
        {
          "expression": "^[Ll]o[0-9.]*$",
          "expression_type": "4"
        },
        {
          "expression": "^[Ss]ystem$",
          "expression_type": "4"
        },
        {
          "expression": "^Nu[0-9.]*$",
          "expression_type": "4"
        }
      ]
    }
  },
  "id": 1
}
```

[comment]: # ({/9087dc56-196e1642})

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

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

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